Fix average calc