#1 - more fixes and test cases