Fix bug in trie lookup code.