Fixed a bug in the stdev calculations.