Simplify remote directory name generation.

It is unnecessary to remove starting / and adding it afterwards.