Fix jshint and some jslint warnings