Fixes and more test cases