correct minor bugs in linear_fit