Fixing the average compuation.