Code: Analysis fixes and formatting.
Merge pull request #1369 from am11/master

Code: Analysis fixes and formatting