Logistic regression fixes