Avoid declaring variables in global scope

The semicolon instead of a comma causes the variables after it to be declared in
global scope.
Merge pull request #337 from voidus/fixVarScope

Avoid declaring variables in global scope