UT update and bug fixes

Updated UT utilities and the test script for mem pool.