Fixed bugs concerning variable statistics.