Fix misuse of max_group