Fixes a bug where the renumbering of the fields did not work after adding or removing an element.