Removed warning caused by calling std::min<int> with size_t values