Fix bugs in tests
Refix test