made linear and logistic regression a little more robust + corrected and error message in test_linear_regression