Fix errors for test cases