Fix incorrect path indexing for greedy routes.

Greedy routes should be indexed without the trailing /. Failing to do that makes paths without trailing arguments fail.

Fixes #3943