fix some coverity issues