fix typos and a few newlines at EOF
Review Request #126081 - Created Nov. 16, 2015 and submitted
Mostly trivial fixes in comments and apidoc, a typo fix in a debug string.
Reduces krazy warnings.
make test failed 11 tests before and after applying the patch.