fix jshint errors and warnings