Fix remote-directory with relative path

Fixes #280.