Fixing bugs in computation of correlation matrix.