Fix broken destination paths with expanded mappings

When using expanding mappings the `file.dest` refers a destination file name, rather than the usual destination directory which was previously assumed.

This results is weirdly nested destination directories.