Fix bug where NaN was not handled by error checks