Remove trailing spaces.

Cleanup superfluous spaces at end of lines so actual changes show easier.
Fix scopes for local variable assignments.