ArrayIterator fixes and unit tests