Fixed "OSError: a file with the same name as the remotedir"