Proper fix for ref counting in trie.