minor fixes and more tests