adding unit tests, fixing ConsistencyCheckingIterator