Renamed prepare to cleanup, since if we do it before the copy the file might not be there yet.
Fixed things up so we fail the operation earlier.