Fixed bugs in converting frequencies to document weigths.
Fixed bugs in  logistic regression!