Cleanup up unused IDs