Clean unused ids.