iterate_and_advance(): get rid of magic in case when n is 0