fix mempool regression
add new test script
IMAP: update new test-script
remove redudant call
remove redundant null check
coverity fixes at low and medium priority
cleanup regression from coverity fixes