last fixes and additional test cases