fix convergence and a mini bug in the gradient for regularizer