Fixes several bugs exposed in #34893 * Fixes relative path handling in copy so that it splits directories and reconstructs the correct file path * Return failed in the proper circumstances