fix FlattenIterator