fix static analysis warning, g++ compile warning