diff --git a/examples/main_fof.c b/examples/main_fof.c
index 6cee578385997e3acf732d6ad373eff4c060a275..571fcf9f1e6432c091f1cebd457c46b1c4874f86 100644
--- a/examples/main_fof.c
+++ b/examples/main_fof.c
@@ -1018,7 +1018,7 @@ int main(int argc, char *argv[]) {
 #endif
 
     /* Perform first FOF search after the first snapshot dump. */
-    //fof_search_tree(&s);
+    fof_search_tree(&s);
 
 #ifdef WITH_MPI
     MPI_Barrier(MPI_COMM_WORLD);
diff --git a/src/engine.c b/src/engine.c
index 22648ea4a6bf0c8801c82805d94c599993811074..9abea543600acae850d220658417946c9cc554c3 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -2203,10 +2203,8 @@ void engine_rebuild(struct engine *e, int repartitioned,
   }
 #endif
 
-  fof_search_tree(e->s);
-
   /* Re-build the tasks. */
-  //engine_maketasks(e);
+  engine_maketasks(e);
 
   /* Make the list of top-level cells that have tasks */
   space_list_useful_top_level_cells(e->s);
@@ -2853,20 +2851,17 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs,
   /* No time integration. We just want the density and ghosts */
   engine_skip_force_and_kick(e);
 
-  //struct scheduler *sched = &e->sched;
-  //struct task *tasks = sched->tasks;
-
-  /* Activate the send and receive tasks for the gparts. */
-  //for (int i = 0; i < sched->nr_tasks; i++) {
+  /* Activate the self and pair FOF tasks and skip all other tasks. */
+  for (int i = 0; i < e->sched.nr_tasks; i++) {
 
-  //  struct task *t = &tasks[i];
+    struct task *t = &e->sched.tasks[i];
 
-  //  t->skip = 1;
+    t->skip = 1;
 
-  //  if (t->type == task_type_fof_self || t->type == task_type_fof_pair) {
-  //    t->skip = 0;
-  //  }
-  //}
+    if (t->type == task_type_fof_self || t->type == task_type_fof_pair) {
+      scheduler_activate(&e->sched, t);
+    }
+  }
 
   /* Print the number of active tasks ? */
   if (e->verbose) engine_print_task_counts(e);
@@ -2892,7 +2887,7 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs,
 
   /* Now, launch the calculation */
   TIMER_TIC;
-  //engine_launch(e);
+  engine_launch(e);
   TIMER_TOC(timer_runners);
 
   /* Apply some conversions (e.g. internal energy -> entropy) */
@@ -2956,7 +2951,7 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs,
 
   /* Run the 0th time-step */
   TIMER_TIC2;
-  //engine_launch(e);
+  engine_launch(e);
   TIMER_TOC2(timer_runners);
 
 #ifdef SWIFT_GRAVITY_FORCE_CHECKS
@@ -3225,7 +3220,7 @@ void engine_step(struct engine *e) {
 
   /* Start all the tasks. */
   TIMER_TIC;
-  //engine_launch(e);
+  engine_launch(e);
   TIMER_TOC(timer_runners);
 
 #ifdef SWIFT_GRAVITY_FORCE_CHECKS
@@ -3363,7 +3358,7 @@ void engine_check_for_dumps(struct engine *e) {
         /* Perform a FOF search. */
         if (e->run_fof) {
 
-          //fof_search_tree(e->s);
+          fof_search_tree(e->s);
           e->run_fof = 0;
         }
 
diff --git a/src/fof.c b/src/fof.c
index b67b47b1c7bd45878e385d3b0e5a0469fea98c55..b2b5d58d453d39c7e8d565e9d1bf4a874ca6811e 100644
--- a/src/fof.c
+++ b/src/fof.c
@@ -1519,37 +1519,6 @@ void fof_search_tree(struct space *s) {
   group_mass = s->fof_data.group_mass;
   group_CoM = s->fof_data.group_CoM;
 
-  ticks tic = getticks();
-
-  engine_maketasks(s->e);
-  //engine_marktasks(s->e);
- 
-  struct scheduler *sched = &s->e->sched;
-  struct task *tasks = sched->tasks;
-
-  /* Activate the self and pair FOF tasks. */
-  for (int i = 0; i < sched->nr_tasks; i++) {
-
-    struct task *t = &tasks[i];
-
-    if (t->type == task_type_fof_self || t->type == task_type_fof_pair) {
-      scheduler_activate(sched, t);
-    }
-
-  }
-
-  engine_print_task_counts(s->e);
-
-  message("Making FOF tasks took: %.3f %s.", clocks_from_ticks(getticks() - tic),
-      clocks_getunit());
-
-  tic = getticks();
-
-  engine_launch(s->e);
-
-  message("Local FOF took: %.3f %s.", clocks_from_ticks(getticks() - tic),
-          clocks_getunit());
-
   ticks tic_calc_group_size = getticks();
 
   threadpool_map(&s->e->threadpool, fof_calc_group_props_mapper,
@@ -1558,12 +1527,6 @@ void fof_search_tree(struct space *s) {
   message("FOF calc group size took (scaling): %.3f %s.",
       clocks_from_ticks(getticks() - tic_calc_group_size), clocks_getunit());
   
-  message("FOF search took (scaling): %.3f %s.",
-      clocks_from_ticks(getticks() - tic_total), clocks_getunit());
-
-  free(group_bc);
-  free(com_set);
-
 #ifdef WITH_MPI
   size_t num_local_roots = 0;
   size_t *local_roots = NULL;
@@ -1631,7 +1594,7 @@ void fof_search_tree(struct space *s) {
 
   message("Sorting groups...");
 
-  tic = getticks();
+  ticks tic = getticks();
 
   /* Find global properties. */
 #ifdef WITH_MPI
diff --git a/src/space.c b/src/space.c
index 19148a73976efcc0f10d6bb8e2800a8fe92f2ef9..24442a232b4f747c2433311f70ad8980e1ffad62 100644
--- a/src/space.c
+++ b/src/space.c
@@ -4388,7 +4388,6 @@ void space_clean(struct space *s) {
   free(s->multipoles_top);
   free(s->local_cells_top);
   free(s->local_cells_with_tasks_top);
-  free(s->cell_index);
   free(s->cells_with_particles_top);
   free(s->local_cells_with_particles_top);
   free(s->parts);