Add missing guards against manipulating incomplete ModelContext objects