use numerical fitting, small bug fix