fix stack overflow in iterators with holes