Fix unit test behaviors