Only allocate trie keys when needed; cut down on unnecessary memory overhead in exploreTrie