Corrected order of copying infiles. Renamed temporary directory.