Fix compilation on win64.
Fix runtime behavior with std::min, std::max on win64