Fix unset variables after a failed file copy.