compile fix for std::min