coverity bugs fix