AM: xtol, ftol, maxit uniformely

In fact ftol is a bad name as it is used in some codes to mean the accuracy of
the objective function, not forces.
AM: do not divide by zero