Fix for NaN check.

Signed-off-by: Patrick Hogan <pbhogan@gmail.com>