Fixed gradients_test bug