Fix compiler complaint about std::min