fix bug when sample.cov contains a single scalar (instead of a matrix)