coverity found some bugs