Fixes a bug when changing the working directory of remote servers.