fix sub-trie prefix matching

when you have `/` and `/a/b/c`, `/a/b` should be handled by `/`.