Setup test env

TestSetFuncSting done and bugs fixed