Fixed compilation problem regarding std::min and std::max