diff --git a/src/ModelTree.cc b/src/ModelTree.cc
index cc27315018044c69f432e0d144d507123962b24c..632e4929ad6e07df751a6195190e278d0fbb7cb9 100644
--- a/src/ModelTree.cc
+++ b/src/ModelTree.cc
@@ -357,6 +357,7 @@ ModelTree::evaluateAndReduceJacobian(const eval_context_t &eval_context) const
   jacob_map_t contemporaneous_jacobian;
   for (const auto &[indices, d1] : derivatives[1])
     {
+      auto &d11 = d1;
       int deriv_id = indices[1];
       if (getTypeByDerivID(deriv_id) == SymbolType::endogenous)
         {
@@ -367,7 +368,7 @@ ModelTree::evaluateAndReduceJacobian(const eval_context_t &eval_context) const
           {
             try
               {
-                return d1->eval(eval_context);
+                return d11->eval(eval_context);
               }
             catch (ExprNode::EvalExternalFunctionException &e)
               {
@@ -1885,11 +1886,14 @@ ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::pat
               mex_compilation_done.insert(output);
   */
             /* The object just compiled may be a prerequisite for several
+            mex_compilation_done.insert(output);
+  */    
+        /* The object just compiled may be a prerequisite for several
                other objects, so notify all waiting workers. Also needed to
                notify the main thread when in
                ModelTree::waitForMEXCompilationWorkers().*/
   /*
-    mex_compilation_cv.notify_all();
+      mex_compilation_cv.notify_all();
           }
     });
   */