Fix unit test issues