Do not remove last path segment unless hash or query are present.
Release 0.1.23.
Start 0.1.24.