Fixed jshint warnings (global vars, missing or extra semicolons)