Add more tests + fix trie problem