Minor changes to js to make the file pass jshint