Try to fix compilation error, could not find std::min(size_t, int)