diff --git a/C11-FrontEnd/examples/C2.thy b/C11-FrontEnd/examples/C2.thy
index 89fa675e3d46db238cbe025e501518e1451a346a..301fddf336da906f7924d45588ca571c54f58cdb 100644
--- a/C11-FrontEnd/examples/C2.thy
+++ b/C11-FrontEnd/examples/C2.thy
@@ -376,8 +376,8 @@ subsection \<open>Continuation Calculus with the C Environment: Presentation in
 declare [[C_parser_trace = false]]
 
 ML\<open>
-fun C src = C_Module.C' (C_Module.env (Context.the_generic_context ())) src
-val C' = C_Module.C'
+val C = C_Module.C' NONE
+val C' = C_Module.C' o SOME
 \<close>
 
 C \<comment> \<open>Nesting C code without propagating the C environment\<close> \<open>
diff --git a/C11-FrontEnd/examples/C_paper.thy b/C11-FrontEnd/examples/C_paper.thy
index 4b8948be929c38e8e8f552dbfd5c36a0457e2aa1..3ef693c4e03a528bc70dbeb9e5ae5faaaf3cc583 100644
--- a/C11-FrontEnd/examples/C_paper.thy
+++ b/C11-FrontEnd/examples/C_paper.thy
@@ -50,17 +50,14 @@ ML\<open>
 val _ = Theory.setup
           (C_Inner_Syntax.command C_Inner_Isar_Cmd.setup' C_Parse.ML_source ("\<simeq>setup", \<^here>, \<^here>))
 
-val C' = C_Module.C'
-
-fun C opt = case opt of NONE => C' (C_Module.env (Context.the_generic_context ()))
-                      | SOME env => C' env
+val C = C_Module.C'
 
 fun C_def dir name _ _ =
   Context.map_theory 
     (C_Inner_Syntax.command'
       (C_Inner_Syntax.drop1
         (C_Scan.Right ( (fn src => fn context =>
-                          C' (C_Stack.Data_Lang.get' context |> #2) src context)
+                          C_Module.C' (SOME (C_Stack.Data_Lang.get' context |> #2)) src context)
                       , dir)))
       C_Parse.C_source
       name)
diff --git a/C11-FrontEnd/src/C_Command.thy b/C11-FrontEnd/src/C_Command.thy
index 9b830b5d4a3fb3eaf4212897878e4e5bf99739fa..3a09dad7f941e51e650f8c7540e806ce83f86bd5 100644
--- a/C11-FrontEnd/src/C_Command.thy
+++ b/C11-FrontEnd/src/C_Command.thy
@@ -360,19 +360,25 @@ fun C source =
   exec_eval source
   #> Local_Theory.propagate_ml_env
 
-fun C' env_lang src context =
-  context
-  |> C_Env.empty_env_tree
-  |> C_Context.eval_source'
-       env_lang
-       (fn src => start src context)
-       err
-       accept
-       src
-  |> (fn (_, {context, reports_text, error_lines}) => 
-     tap (fn _ => case error_lines of [] => () | l => warning (cat_lines (rev l)))
-         (C_Stack.Data_Tree.map (curry C_Stack.Data_Tree_Args.merge (reports_text, []))
-                                context))
+val C' =
+  let
+    fun C env_lang src context =
+      context
+      |> C_Env.empty_env_tree
+      |> C_Context.eval_source'
+           env_lang
+           (fn src => start src context)
+           err
+           accept
+           src
+      |> (fn (_, {context, reports_text, error_lines}) => 
+         tap (fn _ => case error_lines of [] => () | l => warning (cat_lines (rev l)))
+             (C_Stack.Data_Tree.map (curry C_Stack.Data_Tree_Args.merge (reports_text, []))
+                                    context))
+  in
+    fn NONE => (fn src => C (env (Context.the_generic_context ())) src)
+     | SOME env_lang => C env_lang
+  end
 
 fun C_export_file (pos, _) lthy =
   let