fixed several minor issues found by Coverity