Remove unused IDs