fix for covariance matrix of lower dimension