Declare more variables as local
Merge pull request #361 from drkibitz/local-vars

Declare more variables as local