Fixed some code to fit a logistic regression