diff -Nru orig/RSiena/src/model/SdeSimulation.cpp patched/RSiena/src/model/SdeSimulation.cpp
--- orig/RSiena/src/model/SdeSimulation.cpp	2022-04-27 15:17:12.000000000 +0200
+++ patched/RSiena/src/model/SdeSimulation.cpp	2024-02-12 18:08:28.272129200 +0100
@@ -10,12 +10,12 @@
  *****************************************************************************/
 
 #include <cmath> 
-#include <R_ext/Error.h>
-#include <R_ext/Print.h>
-#include <Rinternals.h>
 //#include <Eigen/Dense>
 
 #include "EpochSimulation.h"
+#include <R_ext/Error.h>
+#include <R_ext/Print.h>
+#include <Rinternals.h>
 #include "EffectInfo.h"
 #include "SdeSimulation.h"
 #include "model/Model.h"
diff -Nru orig/RSiena/src/model/ml/Chain.cpp patched/RSiena/src/model/ml/Chain.cpp
--- orig/RSiena/src/model/ml/Chain.cpp	2022-04-27 15:17:13.000000000 +0200
+++ patched/RSiena/src/model/ml/Chain.cpp	2024-02-12 18:08:28.272129200 +0100
@@ -7,12 +7,13 @@
  *
  * Description: This file contains the implementation of the class Chain.
  *****************************************************************************/
-#include <Rinternals.h>
 
 #include <vector>
 #include <stdexcept>
 #include <string>
 
+#include <Rinternals.h>
+
 #include "Chain.h"
 #include "utils/Utils.h"
 #include "utils/Random.h"
diff -Nru orig/RSiena/src/model/ml/MLSimulation.cpp patched/RSiena/src/model/ml/MLSimulation.cpp
--- orig/RSiena/src/model/ml/MLSimulation.cpp	2023-01-29 15:44:43.000000000 +0100
+++ patched/RSiena/src/model/ml/MLSimulation.cpp	2024-02-12 18:08:28.272129200 +0100
@@ -11,8 +11,9 @@
 #include <stdexcept>
 #include <string>
 #include <cmath>
-#include <Rinternals.h>
 #include "MLSimulation.h"
+
+#include <Rinternals.h>
 #include "utils/Random.h"
 #include "utils/Utils.h"
 #include "network/Network.h"
diff -Nru orig/RSiena/src/model/variables/BehaviorVariable.cpp patched/RSiena/src/model/variables/BehaviorVariable.cpp
--- orig/RSiena/src/model/variables/BehaviorVariable.cpp	2022-04-27 15:17:13.000000000 +0200
+++ patched/RSiena/src/model/variables/BehaviorVariable.cpp	2024-02-12 18:13:00.647418300 +0100
@@ -12,11 +12,11 @@
 #include <cmath>
 #include <string>
 #include <stdexcept>
-#include <R_ext/Print.h>
-#include <R_ext/Arith.h>
-#include <Rinternals.h>
 #include "data/ActorSet.h"
 #include "utils/Random.h"
+#include <Rinternals.h>
+#include <R_ext/Print.h>
+#include <R_ext/Arith.h>
 #include "BehaviorVariable.h"
 #include "data/BehaviorLongitudinalData.h"
 #include "model/EpochSimulation.h"
@@ -987,11 +987,11 @@
 
 			if (R_IsNaN(product[effect1]))
 			{
-				Rprintf("effect 1 %d %x \n", effect1, pEffect1);
+				Rprintf("effect 1 %d %p \n", effect1, (void *)pEffect1);
 			}
 			if (R_IsNaN(product[effect2]))
 			{
-				Rprintf("effect2 %d %x \n", effect2, pEffect2);
+				Rprintf("effect2 %d %p \n", effect2, (void *)pEffect2);
 			}
 			this->pSimulation()->derivative(pEffect1->pEffectInfo(),
 				pEffect2->pEffectInfo(),
diff -Nru orig/RSiena/src/model/variables/NetworkVariable.cpp patched/RSiena/src/model/variables/NetworkVariable.cpp
--- orig/RSiena/src/model/variables/NetworkVariable.cpp	2023-05-06 14:15:42.000000000 +0200
+++ patched/RSiena/src/model/variables/NetworkVariable.cpp	2024-02-12 18:08:28.287801900 +0100
@@ -8,12 +8,12 @@
  * Description: This file contains the implementation of the
  * NetworkVariable class.
  *****************************************************************************/
-#include <R_ext/Print.h>
-#include <R_ext/Arith.h>
-#include <Rinternals.h>
 #include <algorithm>
 #include <vector>
 #include <cmath>
+#include <R_ext/Print.h>
+#include <R_ext/Arith.h>
+#include <Rinternals.h>
 #include "NetworkVariable.h"
 #include "network/NetworkUtils.h"
 #include "utils/Utils.h"
diff -Nru orig/RSiena/src/siena07internals.cpp patched/RSiena/src/siena07internals.cpp
--- orig/RSiena/src/siena07internals.cpp	2023-02-05 13:51:16.000000000 +0100
+++ patched/RSiena/src/siena07internals.cpp	2024-02-12 18:10:13.950969600 +0100
@@ -415,7 +415,7 @@
 	int observations = Rf_length(ONEMODES);
 	if (observations != pOneModeNetworkLongitudinalData->observationCount())
 	{
-		error(("wrong number of observations in: " + name + ": expected "
+		error("%s", ("wrong number of observations in: " + name + ": expected "
 				+ toString(pOneModeNetworkLongitudinalData->observationCount()) + " got "
 				+ toString(observations)).c_str());
 	}
diff -Nru orig/RSiena/src/siena07setup.cpp patched/RSiena/src/siena07setup.cpp
--- orig/RSiena/src/siena07setup.cpp	2023-05-05 16:35:39.000000000 +0200
+++ patched/RSiena/src/siena07setup.cpp	2024-02-12 18:08:28.304365600 +0100
@@ -14,7 +14,6 @@
  * Sets up the Data object with data from R
  */
 
-#include "siena07setup.h"
 
 #include <vector>
 #include <cstring>
@@ -23,6 +22,8 @@
 #include <R_ext/Print.h>
 #include <R_ext/Error.h>
 #include <Rinternals.h>
+
+#include "siena07setup.h"
 #include "siena07internals.h"
 #include "siena07utilities.h"
 #include "data/Data.h"
diff -Nru orig/RSiena/src/siena07utilities.cpp patched/RSiena/src/siena07utilities.cpp
--- orig/RSiena/src/siena07utilities.cpp	2023-09-29 19:00:31.000000000 +0200
+++ patched/RSiena/src/siena07utilities.cpp	2024-02-12 18:08:28.320052500 +0100
@@ -115,7 +115,7 @@
 	}
 	catch(exception& e)
 	{
-		error(e.what());
+		error("%s", e.what());
 	}
 }
 
