Fix UT failure in test_kstate