logscale fitting properly penalizes NaNs