Fix DV calculation; added more tests.