fix few bugs and unused issues in functional tests