Hopefully fix the file copying function by using a temporary file in the root folder and then renaming. Copying directly into subdirectories proved to cause errors with some files, but copying to the root seems to never fail.