NDSIterator: fixed two bugs