Fixed some errors in averages