jshint fixes, fix global leak