Cleaned up the file copy code.