add some error handling to the iterator, see #166