fixed a few 'code analysis' issues