Fix a vicious bug in nditerator