Fix errors resulting from flaws in assumptions about BitTrie. Simplify
iterator code.