Added L2 regularized logistic regression and some bug fixes