diff --git a/src/ComputingTasks.cc b/src/ComputingTasks.cc
index 5eac1f8422558aba4974ab655a06441e2e39505c..b9157bf1d3ed4af46d45447a73bc9d926352a5b1 100644
--- a/src/ComputingTasks.cc
+++ b/src/ComputingTasks.cc
@@ -305,7 +305,7 @@ PacModelStatement::overwriteGrowth(expr_t new_growth)
         growth_info.emplace_back(gv->symb_id, gv->lag, -1, 1);
       else
         {
-          cerr << "Pac growth must be a linear combination of varibles" << endl;
+          cerr << "Pac growth must be a linear combination of variables" << endl;
           exit(EXIT_FAILURE);
         }
     }
diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc
index fdf8c1a8ae99ce72beb2ddc4ad9c17112cc8dae4..f095c3b6fd2f8bc738d616aa3438b531e5cc902b 100644
--- a/src/DynamicModel.cc
+++ b/src/DynamicModel.cc
@@ -4706,16 +4706,8 @@ DynamicModel::fillPacModelInfo(const string &pac_model_name,
 {
   pac_eqtag_and_lag.insert(eqtag_and_lag.begin(), eqtag_and_lag.end());
 
-  bool stationary_vars_present = false;
-  bool nonstationary_vars_present = false;
-  for (auto it : nonstationary)
-    if (nonstationary_vars_present && stationary_vars_present)
-      break;
-    else
-      if (it)
-        nonstationary_vars_present = true;
-      else
-        stationary_vars_present = true;
+  bool stationary_vars_present = any_of(nonstationary.begin(), nonstationary.end(), logical_not<bool>());
+  bool nonstationary_vars_present = any_of(nonstationary.begin(), nonstationary.end(), [](bool b) { return b; }); // FIXME: use std::identity instead of an anonymous function when we upgrade to C++20
 
   int growth_param_index = -1;
   if (growth != nullptr)