fixing more tests, also some actual bugs found by the tests…