Code: Analysis fixes and formatting