remove one explicit global and other smaller cleanups

fix one explicit global, remove unused variables and add missing semicolons to make jshint happy(er).