fix sub-trie prefix matching

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