more minor fixes
more tests
TODO