Fix misc static analyzer issues.
Merge pull request #962 from ktf/misc-static-analyzer

Misc fixes -- Fix misc static analyzer issues.