isnan and isinf fixes for msvc