rewrote test_exists; fixed few other tests