Fixed getAverages.