Logistic regression gradient fixed