Added options to config structure to decide how failed calibrations should be recorded in the gain output.  Opotion to ignore, print fail message, or print an average value of the gain.
Sometime the calibration fit fails to move from the initial estimate values.  Added check for this and if it happens the initial gain is shifted by a random +/- 0.05 and the fit is called again.  MAximum of five attempts allowed.