diff --git a/error.h b/error.h
index d5e331486620f77cbf16b15ad673a9c43ad7876b..bda6a62106d387cfa62076d9e5299b8a11d44f3d 100644
--- a/error.h
+++ b/error.h
@@ -1,4 +1,5 @@
 #include <mpi.h>
+
 #include "clocks.h"
 
 extern int myrank;
diff --git a/format.sh b/format.sh
index 91346334c9b2eaf9fbb343aba44f8a02d866d1ef..db5e7ab01a1603b987c3fa7e83a8736ed7faea31 100755
--- a/format.sh
+++ b/format.sh
@@ -1,8 +1,8 @@
 #!/bin/bash
 
 # Clang format command, can be overridden using CLANG_FORMAT_CMD.
-# We currrently use version 5.0 so any overrides should provide that.
-clang=${CLANG_FORMAT_CMD:="clang-format-5.0"}
+# We currrently use version 13.0 so any overrides should provide that.
+clang=${CLANG_FORMAT_CMD:="clang-format-13.0"}
 
 # Formatting command
 cmd="$clang -style=file $(git ls-files | grep '\.[ch]$')"
diff --git a/histogram.c b/histogram.c
index 0995ac2004a9d024e9140bcf0af897a2f7f4143a..d9b1609db8e22abcbe5076e8c061538dc09d4212 100644
--- a/histogram.c
+++ b/histogram.c
@@ -1,11 +1,11 @@
+#include "histogram.h"
+
 #include <float.h>
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include "histogram.h"
-
 /*
  * Simple histogram routines.
 int main(int argc, char *argv[]) {
diff --git a/mpiuse.c b/mpiuse.c
index 7e5b7d7b6c7c258379be593515c4bcebadf1ea4e..e25981defe39914f325f895eb382fd2d7c1e3827 100644
--- a/mpiuse.c
+++ b/mpiuse.c
@@ -400,10 +400,10 @@ void mpiuse_log_generate(int nr_nodes, int nr_logs, int size, int random,
     for (int i = 0; i < nr_nodes; i++) {
       for (int j = 0; j < nr_nodes; j++) {
         if (i != j) {
-          mpiuse_log_allocation(i, 1, k, SEND_TYPE, NO_SUBTYPE, 1, (size_t)logsize, j,
-                                tag);
-          mpiuse_log_allocation(j, 1, k, RECV_TYPE, NO_SUBTYPE, 1, (size_t)logsize, i,
-                                tag);
+          mpiuse_log_allocation(i, 1, k, SEND_TYPE, NO_SUBTYPE, 1,
+                                (size_t)logsize, j, tag);
+          mpiuse_log_allocation(j, 1, k, RECV_TYPE, NO_SUBTYPE, 1,
+                                (size_t)logsize, i, tag);
         }
       }
     }
diff --git a/swiftmpifakestepsim.c b/swiftmpifakestepsim.c
index 777531c73ec753cc378bffa6069b42297082675b..d14d8538de4f2cd51d599881b6dcd4e9ef6678c8 100644
--- a/swiftmpifakestepsim.c
+++ b/swiftmpifakestepsim.c
@@ -305,7 +305,7 @@ static int cmp_logs(const void *p1, const void *p2) {
  * otherwise the order is randomized.
  *
  * @param random randomize injection order of sends or sends and recvs,
- *               otherwise use order of the original logs. Just sends 
+ *               otherwise use order of the original logs. Just sends
  *               are randomized when 1, 2 randomizes both, 0 neither.
  */
 static void pick_logs(int random) {
@@ -523,7 +523,7 @@ int main(int argc, char *argv[]) {
     if (randomorder == 1) message("Message send order randomized");
     if (randomorder == 2) message("Message send and recv order randomized");
   }
-                          
+
   pick_logs(randomorder);
 
   /* Time to start time. Try to make it synchronous across the ranks. */