(* Checks suppressed *)
          (* Let's visit all the subterms that will not be visited later *)
          let (cl,parsno) =
-          match CicEnvironment.get_cooked_obj uri with
+           let obj =
+             try
+               CicEnvironment.get_cooked_obj uri
+             with Not_found -> assert false
+           in
+          match obj with
              C.InductiveDefinition (tl,_,parsno) ->
               let (_,_,_,cl) = List.nth tl i in (cl,parsno)
            | _ ->
 
  and visit_exp_named_subst context uri exp_named_subst =
   let uris_and_types =
-   match CicEnvironment.get_cooked_obj uri with
+     let obj =
+       try
+         CicEnvironment.get_cooked_obj uri
+       with Not_found -> assert false
+     in
+    match obj with
       Cic.Constant (_,_,_,params)
     | Cic.CurrentProof (_,_,_,_,params)
     | Cic.Variable (_,_,_,params)
     | Cic.InductiveDefinition (_,params,_) ->
        List.map
         (function uri ->
-          match CicEnvironment.get_cooked_obj uri with
+           let obj =
+             try
+               CicEnvironment.get_cooked_obj uri
+             with Not_found -> assert false
+           in
+           match obj with
              Cic.Variable (_,None,ty,_) -> uri,ty
            | _ -> assert false (* the theorem is well-typed *)
         ) params