diff --git a/examples/main.c b/examples/main.c
index 995231789915fb26574dbccfc2696f8449a1e679..b38347c3b04ddbff7df2dd89542b5fda908f03f8 100644
--- a/examples/main.c
+++ b/examples/main.c
@@ -771,9 +771,9 @@ int main(int argc, char *argv[]) {
     /* Initialize the engine with the space and policies. */
     if (myrank == 0) clocks_gettime(&tic);
     engine_init(&e, &s, params, N_total[0], N_total[1], engine_policies,
-                talking, &reparttype, &us, &prog_const, &hydro_properties,
-                &gravity_properties, &potential, &cooling_func, &chemistry,
-                &sourceterms);
+                talking, &reparttype, &us, &prog_const, &cosmo,
+                &hydro_properties, &gravity_properties, &potential,
+                &cooling_func, &chemistry, &sourceterms);
     engine_config(0, &e, params, nr_nodes, myrank, nr_threads, with_aff,
                   talking, restart_file);
     if (myrank == 0) {
@@ -869,8 +869,7 @@ int main(int argc, char *argv[]) {
     if (with_verbose_timers) timers_print(e.step);
 
     /* Every so often allow the user to stop the application and dump the
-     * restart
-     * files. */
+     * restart files. */
     if (j % restart_stop_steps == 0) {
       force_stop = restart_stop_now(restart_dir, 0);
       if (myrank == 0 && force_stop)
@@ -878,8 +877,7 @@ int main(int argc, char *argv[]) {
     }
 
     /* Also if using nsteps to exit, will not have saved any restarts on exit,
-     * make
-     * sure we do that (useful in testing only). */
+     * make sure we do that (useful in testing only). */
     if (force_stop || (e.restart_onexit && e.step - 1 == nsteps))
       engine_dump_restarts(&e, 0, 1);
 
diff --git a/src/engine.c b/src/engine.c
index 69c5a5d49ff5841df1bcaced94a18742eb6c3e3c..d4fad484560d53d67d149da7d9f1e3e58cd83a31 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -5173,7 +5173,7 @@ void engine_init(
     struct engine *e, struct space *s, const struct swift_params *params,
     long long Ngas, long long Ndm, int policy, int verbose,
     struct repartition *reparttype, const struct unit_system *internal_units,
-    const struct phys_const *physical_constants,
+    const struct phys_const *physical_constants, struct cosmology *cosmo,
     const struct hydro_props *hydro, const struct gravity_props *gravity,
     const struct external_potential *potential,
     const struct cooling_function_data *cooling_func,
@@ -5222,6 +5222,7 @@ void engine_init(
   e->count_step = 0;
   e->wallclock_time = 0.f;
   e->physical_constants = physical_constants;
+  e->cosmology = cosmo;
   e->hydro_properties = hydro;
   e->gravity_properties = gravity;
   e->external_potential = potential;
diff --git a/src/engine.h b/src/engine.h
index 396c24ef6cfcb7c41f00f5f15269bd6cddc59a8a..288a24bdba2d2b69d46e285079a47d4d7a7a84c8 100644
--- a/src/engine.h
+++ b/src/engine.h
@@ -328,7 +328,7 @@ void engine_init(
     struct engine *e, struct space *s, const struct swift_params *params,
     long long Ngas, long long Ndm, int policy, int verbose,
     struct repartition *reparttype, const struct unit_system *internal_units,
-    const struct phys_const *physical_constants,
+    const struct phys_const *physical_constants, struct cosmology *cosmo,
     const struct hydro_props *hydro, const struct gravity_props *gravity,
     const struct external_potential *potential,
     const struct cooling_function_data *cooling_func,