Fix standard deviation calculations