Fixing Trie implementations