Really fixed the mutation issue in aggregate_losses