Workaround for the VS10 min macro problem

VS10 has a min macro that gives a building error. Placing parenthesis around std::min gives a clean workaround.