Fix iteration counter.