- Properly check the object id in generate_id()