fix weighted covariance