Fixed average computation error.