fixed unit test bugs