Crash fix for creating file in remote directory.