Cleanup for trie