diff --git a/src/DataTree.cc b/src/DataTree.cc
index 4fb897fdb548754333060abec3a3a65b5737c1d0..f24c3030a6d53126e25ae35be1728d7f4c03d465 100644
--- a/src/DataTree.cc
+++ b/src/DataTree.cc
@@ -119,7 +119,7 @@ DataTree::operator=(const DataTree &d)
   return *this;
 }
 
-expr_t
+NumConstNode *
 DataTree::AddNonNegativeConstant(const string &value)
 {
   int id = num_constants.AddNonNegativeConstant(value);
diff --git a/src/DataTree.hh b/src/DataTree.hh
index 0b6e6b007c01c0bd6c436c186693a321d8ca092e..62da568185f0a0cfd1a7f10f32ea92473f502ac1 100644
--- a/src/DataTree.hh
+++ b/src/DataTree.hh
@@ -140,7 +140,8 @@ public:
   DataTree &operator=(DataTree &&) = delete;
 
   //! Some predefined constants
-  expr_t Zero, One, Two, Three, MinusOne, NaN, Infinity, MinusInfinity, Pi;
+  NumConstNode *Zero, *One, *Two, *Three, *NaN, *Infinity, *Pi;
+  expr_t MinusOne, MinusInfinity;
 
   //! Raised when a local parameter is declared twice
   class LocalVariableException
@@ -158,7 +159,7 @@ public:
 
   inline expr_t AddPossiblyNegativeConstant(double val);
   //! Adds a non-negative numerical constant (possibly Inf or NaN)
-  expr_t AddNonNegativeConstant(const string &value);
+  NumConstNode *AddNonNegativeConstant(const string &value);
   //! Adds a variable
   VariableNode *AddVariable(int symb_id, int lag = 0);
   //! Gets a variable
diff --git a/src/ModFile.cc b/src/ModFile.cc
index 2892fbfc2e01be4e74ce7258b4e4ffa5e1dc726e..6346c8203fde9f3344b691492640e1a81db5725a 100644
--- a/src/ModFile.cc
+++ b/src/ModFile.cc
@@ -578,7 +578,7 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, bool
 
       /* Create auxiliary parameters and the expression to be substituted into
          the var_expectations statement */
-      auto subst_expr = dynamic_model.Zero;
+      expr_t subst_expr = dynamic_model.Zero;
       for (int lag = 0; lag < max_lag; lag++)
         for (auto variable : lhs)
           {