Handle trailing slash in get path.
Throw exception if anything but the last component of a path returns null.