Fixes for Coverity