Fix bug with files mode while copying