fix some problems in Linear Regression