Fix average2 logic