fix handling of generating path with a mountpoint ending with '/'