fix spelling errors
fix comment
minor code simplications
don't pass as reference where not required to be
Merge pull request #3298 from eileenmcnaughton/code-cleanup

Code cleanup