fixed impute_by_groups for mode