fixed unit test and functional tests