Fix Coverity defects