Fix deleting elements.