fix issues found by coverity