Fix a bug with array iterators