Remove trailing spaces.

Cleanup superfluous spaces at end of lines so actual changes show easier.
Fix scopes for local variable assignments.
Merge pull request #8 from boughtonp/master

Fix unscoped local variables.