Add missing #include <algorithm> (std::min and std::max are defined in algorithm)