Changed all calls to std to have ddof=1 (use unbiased form).