Fix bug with array iteration.