Clean up isnan checks