Fixed wrong order of copying files.