Fix max(cv) not grouping correctly.