Fixed some bugs in the variances