Fix VS2013 build.

More std::min / std::max complaints from 2013 as usual.