On the asymptotic distribution of max and mex