fix coverity issues
Merge pull request #174 from volvet/coverity_issue_fix

fix coverity issues 26973, 26974, 26975, 26976, 26972, 26980.