Fix panic when calling Parent() on an empty path