[RFC] Fix coverity issues. (1)

Fix some coverity issues.