Fix stupid bugs in trie insertion