Fixed some code analysis issues