Fixing some code analysis issues