Fixed bug in convergence calculation