Fixed fetching next group number for create_group_ids script