fixed coverity issues that were reported