Fix copyTo/moveTo overwrite bug.