Fixed cleanup tools to use new id iterator