Fixed bug where deleting a form element leaves orphans behind