Fixes and update test cases