Fixed getAverage.