Fix unit test case errors