Fix bug with negative values on linear regression