Fix RemoteFile and RemoteDirectory.