small fixes and more tests