more tests + fixed some bugs