Changed some exceptions raised from ValueError to DistlibException, refined some tests.