Conversion to SciPy and bug fix.