Fix bug for the counting of convergence.