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

Not sure why this is happening, but perhaps scipy.optimize.minpack has been updated since this module was updated? Sorry about the multiple commits.