Fix unit test bug