Fix some coverity issues.