diff --git a/src/CodeInterpreter.hh b/src/CodeInterpreter.hh
index daa19950d70a3e7de50350302e748d912b39baf4..c9881c9e2f65c1a565dc3e3b4d7964508432d8b4 100644
--- a/src/CodeInterpreter.hh
+++ b/src/CodeInterpreter.hh
@@ -1484,7 +1484,7 @@ public:
                unsigned int det_exo_size_arg, unsigned int nb_col_det_exo_jacob_arg, unsigned int exo_size_arg, unsigned int nb_col_exo_jacob_arg, unsigned int other_endo_size_arg, unsigned int nb_col_other_endo_jacob_arg,
                const vector<unsigned int> &det_exogenous_arg, const vector<unsigned int> &exogenous_arg, const vector<unsigned int> &other_endogenous_arg) :
     size{static_cast<int>(size_arg)},
-    type{type_arg},
+    type{static_cast<uint8_t>(type_arg)},
     variable{variable_arg.begin()+first_element, variable_arg.begin()+(first_element+block_size)},
     equation{equation_arg.begin()+first_element, equation_arg.begin()+(first_element+block_size)},
     other_endogenous{other_endogenous_arg},
@@ -1509,7 +1509,7 @@ public:
                const vector<int> &variable_arg, const vector<int> &equation_arg,
                bool is_linear_arg, int endo_nbr_arg, int Max_Lag_arg, int Max_Lead_arg, int &u_count_int_arg, int nb_col_jacob_arg) :
     size{static_cast<int>(size_arg)},
-    type{type_arg},
+    type{static_cast<uint8_t>(type_arg)},
     variable{variable_arg.begin()+first_element, variable_arg.begin()+(first_element+block_size)},
     equation{equation_arg.begin()+first_element, equation_arg.begin()+(first_element+block_size)},
     is_linear{is_linear_arg},
diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc
index 7c0cbf8f2ef703353e83ea71efde9538189e5333..d6989d37cc9e1811bb614f4db0974f6c99af0df9 100644
--- a/src/DynamicModel.cc
+++ b/src/DynamicModel.cc
@@ -39,7 +39,7 @@ DynamicModel::copyHelper(const DynamicModel &m)
   for (const auto &it : m.static_only_equations)
     static_only_equations.push_back(dynamic_cast<BinaryOpNode *>(f(it)));
 
-  auto convert_vector_tt = [this,f](vector<temporary_terms_t> vtt)
+  auto convert_vector_tt = [f](vector<temporary_terms_t> vtt)
     {
       vector<temporary_terms_t> vtt2;
       for (const auto &tt : vtt)
@@ -72,7 +72,7 @@ DynamicModel::copyHelper(const DynamicModel &m)
   for (const auto &it : m.dynamic_jacobian)
     dynamic_jacobian[it.first] = f(it.second);
 
-  auto convert_derivative_t = [this,f](derivative_t dt)
+  auto convert_derivative_t = [f](derivative_t dt)
     {
       derivative_t dt2;
       for (const auto &it : dt)
diff --git a/src/ModelTree.hh b/src/ModelTree.hh
index 8f746a7742fbf07321d51d187b88a80f8a7ef5fe..e335e5d7fef39ed83c7146b3bc31781deab095e2 100644
--- a/src/ModelTree.hh
+++ b/src/ModelTree.hh
@@ -27,6 +27,7 @@ using namespace std;
 #include <deque>
 #include <map>
 #include <ostream>
+#include <array>
 
 #include "DataTree.hh"
 #include "ExtendedPreprocessorTypes.hh"
diff --git a/src/StaticModel.cc b/src/StaticModel.cc
index 3a4a2f6987dd2c51d2204d47eb20d6f0da093cd9..549dfe0bd4ff4a24717abf447159982efdd6e347 100644
--- a/src/StaticModel.cc
+++ b/src/StaticModel.cc
@@ -35,7 +35,7 @@ StaticModel::copyHelper(const StaticModel &m)
 {
   auto f = [this](expr_t e) { return e->clone(*this); };
 
-  auto convert_vector_tt = [this,f](vector<temporary_terms_t> vtt)
+  auto convert_vector_tt = [f](vector<temporary_terms_t> vtt)
     {
       vector<temporary_terms_t> vtt2;
       for (const auto &tt : vtt)
@@ -70,7 +70,7 @@ StaticModel::copyHelper(const StaticModel &m)
   for (const auto &it : m.dynamic_jacobian)
     dynamic_jacobian[it.first] = f(it.second);
 
-  auto convert_derivative_t = [this,f](derivative_t dt)
+  auto convert_derivative_t = [f](derivative_t dt)
     {
       derivative_t dt2;
       for (const auto &it : dt)
diff --git a/src/macro/MacroValue.hh b/src/macro/MacroValue.hh
index eae88e2a45cfcebc91feff9de64d9741fd36fabf..04ed062f1df711b372b3a334207ab81742fbea91 100644
--- a/src/macro/MacroValue.hh
+++ b/src/macro/MacroValue.hh
@@ -41,6 +41,7 @@ using MacroValuePtr = shared_ptr<MacroValue>;
 class MacroValue
 {
 public:
+  virtual ~MacroValue() = default;
   //! Exception thrown when type error occurs in macro language
   class TypeError
   {
@@ -118,6 +119,7 @@ class IntMV : public MacroValue
 {
 public:
   explicit IntMV(int value_arg);
+  virtual ~IntMV() = default;
   
   //! Underlying integer value
   const int value;
@@ -156,6 +158,7 @@ class StringMV : public MacroValue
 {
 public:
   explicit StringMV(string value_arg);
+  virtual ~StringMV() = default;
   //! Underlying string value
   const string value;
   
@@ -175,6 +178,7 @@ class FuncMV : public MacroValue
 {
 public:
   FuncMV(vector<string> args, string body_arg);
+  virtual ~FuncMV() = default;
   //! Function args & body
   const vector<string> args;
   const string body;
@@ -189,6 +193,7 @@ class ArrayMV : public MacroValue
 {
 public:
   explicit ArrayMV(vector<MacroValuePtr> values_arg);
+  virtual ~ArrayMV() = default;
 
   //! Underlying vector
   const vector<MacroValuePtr> values;
@@ -230,6 +235,7 @@ class TupleMV : public MacroValue
 {
 public:
   explicit TupleMV(vector<MacroValuePtr> values_arg);
+  virtual ~TupleMV() = default;
 
   //! Underlying vector
   const vector<MacroValuePtr> values;