diff --git a/src/engine.c b/src/engine.c
index 26545aa96e616d9b5bad695d8c55044c559855e0..ecc48ba336c02b852c838bd9da6ff910e4405460 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -293,7 +293,7 @@ void engine_repartition(struct engine *e) {
 
   int i, j, k, l, cid, cjd, ii, jj, kk, res;
   idx_t *inds, *nodeIDs;
-  idx_t *weights_v, *weights_e;
+  idx_t *weights_v = NULL, *weights_e = NULL;
   struct space *s = e->s;
   int nr_cells = s->nr_cells, my_cells = 0;
   struct cell *cells = s->cells;
@@ -366,7 +366,7 @@ void engine_repartition(struct engine *e) {
 
     /* Get the task weight. */
     idx_t w = (t->toc - t->tic) * wscale;
-    if (w < 0) error("Bad task weight (%i).", w);
+    if (w < 0) error("Bad task weight (%"SCIDX").", w);
 
     /* Do we need to re-scale? */
     wtot += w;
diff --git a/src/parallel_io.c b/src/parallel_io.c
index adcb997e57bb0a652628090734fe9bd3133cf260..1d6188e80de98b812a4d48d593d5c3ab7402edfb 100644
--- a/src/parallel_io.c
+++ b/src/parallel_io.c
@@ -23,9 +23,6 @@
 
 #if defined(HAVE_HDF5) && defined(WITH_MPI) && defined(HAVE_PARALLEL_HDF5)
 
-/* Tell hdf5 that we intend to use shared-memory parallel stuff. */
-#define H5_HAVE_PARALLEL
-
 /* Some standard headers. */
 #include <hdf5.h>
 #include <math.h>
diff --git a/src/serial_io.c b/src/serial_io.c
index a9993f0ef728c8f2158f67a7eef1497632aca848..501ecd3d566dc0a770db4a6bd2bc60cdfda3477a 100644
--- a/src/serial_io.c
+++ b/src/serial_io.c
@@ -325,12 +325,7 @@ void prepareArray(hid_t grp, char* fileName, FILE* xmfFile, char* name,
                   enum DATA_TYPE type, long long N_total, int dim,
                   struct UnitSystem* us, enum UnitConversionFactor convFactor) {
   hid_t h_data = 0, h_err = 0, h_space = 0;
-  void* temp = 0;
-  int i = 0, rank = 0;
-  const size_t typeSize = sizeOfType(type);
-  const size_t copySize = typeSize * dim;
-  const size_t partSize = sizeof(struct part);
-  char* temp_c = 0;
+  int rank = 0;
   hsize_t shape[2];
   char buffer[150];
 
@@ -399,7 +394,7 @@ void writeArrayBackEnd(hid_t grp, char* name, enum DATA_TYPE type, int N,
                        int dim, long long N_total, long long offset,
                        char* part_c) {
   hid_t h_data = 0, h_err = 0, h_memspace = 0, h_filespace = 0;
-  hsize_t shape[2], shape_total[2], offsets[2];
+  hsize_t shape[2], offsets[2];
   void* temp = 0;
   int i = 0, rank = 0;
   const size_t typeSize = sizeOfType(type);
@@ -423,16 +418,12 @@ void writeArrayBackEnd(hid_t grp, char* name, enum DATA_TYPE type, int N,
     rank = 2;
     shape[0] = N;
     shape[1] = dim;
-    shape_total[0] = N_total;
-    shape_total[1] = dim;
     offsets[0] = offset;
     offsets[1] = 0;
   } else {
     rank = 1;
     shape[0] = N;
     shape[1] = 0;
-    shape_total[0] = N_total;
-    shape_total[1] = 0;
     offsets[0] = offset;
     offsets[1] = 0;
   }