bugfixes for AdaGrad