Re #9030. Changed getCovarianceMatrix to return a const Matrix