Bugfix: URLPath.is_leaf could sometimes return a non-boolean.