fix high risk coverity warnings