Fix total_average