Crash fix for image.analysis.bgfit.
Crash fix for image.analysis.imstat.