Fix iteration variable in AdaGrad.
Avoid potential division by zero.
fixing merge conflicts
reverting trick that I thought was going to work