Fixed generation of id list