fix bug with leading empty string

There is poor test coverage for foreign root directories, but this patch at least does fix the bug in the ticket according to my manual testing.