Fixed a bug in the module that breaks scipy.optimize.leastsq

Not sure why this is happening, but it's discrepant.