Coverity defect fixing