Lots of fixes plus addition of convergence check