Fix a defect where id wasn't generated correctly