added jshint and fixed some warnings