Add missing ModelContext state guards.