Minor code cleanups

* doc fixes
* redundant var decl
* consolidated some code into addWarning to reduce code size

Change-Id: I944b8527c68603f2c688f63964c18808642627f5
Merge "Minor code cleanups"