Make remove_elements correctly use ElementFilters.