Use local filename as remote name when trailing slash on remote path
Fixes #2