Fixes mean to Return NaN if average fails