Fixed exception during undo.
Fixed class cast exception of undo of a delete of a linked model
element.
Generated source code.