fixed a few minor coverity issues