Fixed the average stars function.