Added error bar weighting to the curve_fit call and a test case that makes the fit produce bogus numbers