fix up logging of iterations when we're about to quit