Correct loop counter