Fix vardiff calculation