clean up C vector and trie, rid of mem leaks