Removing an element from a container in the model browser or from a diagram or view can cause faulty references within the tool. If a reference has been made to an element and it is removed from the model, it will show up in a color view as an undefined element. It will also show in other reporting features, but most common is it shows up in the color view.
While the color view is still open, look up the element that has the "faulty" statement in the legend, it will represent itself as follows:
This "faulty" reference can be removed by executing the following script:
To prevent this phenomenon from occurring it is best to do a check before removing an already long time existing element if it has been referenced. The Where used command in the object's context menu is useful to see where the element has been referenced.