Reported in #399 the calculations of averages return an incorrect value for the last day of the simulation.