Fix argument types mismatch in std::max