diff --git a/src/partition.c b/src/partition.c
index 54abf3c811352673d04d1c5f1cd6a84839de28d0..6c9927d8cde5041caa932c6d688bdf3d5f3f7e59 100644
--- a/src/partition.c
+++ b/src/partition.c
@@ -442,7 +442,7 @@ static void pick_metis(struct space *s, int nregions, double *vertexw,
    * of old and new ranks. Each element of the array has a cell count and
    * an unique index so we can sort into decreasing counts. */
   int indmax = nregions * nregions;
-  struct indexval *ivs = (indexval *)malloc(sizeof(struct indexval) * indmax);
+  struct indexval *ivs = (struct indexval *)malloc(sizeof(struct indexval) * indmax);
   bzero(ivs, sizeof(struct indexval) * indmax);
   for (int k = 0; k < ncells; k++) {
     int index = regionid[k] + nregions * s->cells_top[k].nodeID;
diff --git a/src/runner.c b/src/runner.c
index 1f4260a8b0290081c6e0034feb4efd2981d600d7..4a79bd6bebf7508fb6bac24a8019d02b57e85d53 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -2002,7 +2002,7 @@ void *runner_main(void *data) {
           break;
         case task_type_recv:
           if (t->subtype == task_subtype_tend) {
-            cell_unpack_end_step(ci, (pcell_step *)t->buff);
+            cell_unpack_end_step(ci, (struct pcell_step *)t->buff);
             free(t->buff);
           } else if (t->subtype == task_subtype_xv) {
             runner_do_recv_part(r, ci, 1, 1);
@@ -2015,7 +2015,7 @@ void *runner_main(void *data) {
           } else if (t->subtype == task_subtype_spart) {
             runner_do_recv_spart(r, ci, 1);
           } else if (t->subtype == task_subtype_multipole) {
-            cell_unpack_multipoles(ci, (gravity_tensors *)t->buff);
+            cell_unpack_multipoles(ci, (struct gravity_tensors *)t->buff);
             free(t->buff);
           } else {
             error("Unknown/invalid task subtype (%d).", t->subtype);
diff --git a/src/scheduler.c b/src/scheduler.c
index a48b7abdba22cada2a0781ea6e5a07f32eda0460..b75c5f474a4c9998a06e1834acebada08198afcf 100644
--- a/src/scheduler.c
+++ b/src/scheduler.c
@@ -1501,7 +1501,7 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
 #ifdef WITH_MPI
         if (t->subtype == task_subtype_tend) {
             t->buff = (struct pcell_step *)malloc(sizeof(struct pcell_step) * t->ci->pcell_size);
-          cell_pack_end_step(t->ci, (pcell_step *)t->buff);
+          cell_pack_end_step(t->ci, (struct pcell_step *)t->buff);
           if ((t->ci->pcell_size * sizeof(struct pcell_step)) >
               s->mpi_message_limit)
             err = MPI_Isend(
@@ -1539,7 +1539,7 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
                              t->cj->nodeID, t->flags, MPI_COMM_WORLD, &t->req);
         } else if (t->subtype == task_subtype_multipole) {
             t->buff = (struct gravity_tensors *)malloc(sizeof(struct gravity_tensors) * t->ci->pcell_size);
-          cell_pack_multipoles(t->ci, (gravity_tensors *)t->buff);
+          cell_pack_multipoles(t->ci, (struct gravity_tensors *)t->buff);
           err = MPI_Isend(
               t->buff, t->ci->pcell_size * sizeof(struct gravity_tensors),
               MPI_BYTE, t->cj->nodeID, t->flags, MPI_COMM_WORLD, &t->req);