added a couple more tests, fixed some bugs