handle NaNs better.