Coverity fixes from Nelson