Fix trie bug when using aggregates.