some fixes and more tests