Fixed 'average of an array'