Fix coverity varnings (hopefully). Refs #9939
Merge branch 'bugfix/9939_Coverity_CurveFitting' into develop