Removed unused code
Code analysis fixes
* Fixed a suspicious shadowed variable
* Code style fixes