Use cov->dim instead of cov->n_vars where appropriate