Fix iteration indexes