test, and some fixes
more tests and fixes