Fixed two RuntimeExceptions regarding ContainedNamedElements and
ContainmentPathElements that can occur when the model is invalid, such
as when in the midst of typing a model in the editor.