Fixed denomanator in covariance calculation