Code: More analysis warning fixes

and fixes formatting.

/cc @xzyfer, @mgreter