Fix id_count bug