issue-612: added missing include for std::min

Otherwise Visual Studio 2013 rightfully complains