Recognize bad values (and set to nan)