[dev] Fixed regressions in fit_linear and fit_nonlinear.