Repaired some problem with copying files after renaming