fixed some bugs and 2 more tests