Fix inserting multiple copies of ignored elements

This could cause the form to become impossible to save after saving a few times as the number of duplicate ignored elements grew exponentially.
Fix error on ignore/retain in <head>