Fix log messages not correctly showing the number of iterations