fix jshint warnings and errors