Fix iteration convergence bug.

Trainer would crash when converged.