Bug Fix regarding the averages calculation