Improved curve fit exception handling.