Fix and update test cases