Fixed violations reported by Coverity