Fixed logical error in convergence or max num generations check