fix some problem about the function of the leastsq method.