coverity bug fixes