Fix max error breaking of loop.