Fix trie return order