Fixed hopefully the last few Coverity issues