fits modified to work with complex curves

(except manual_fits)