various jshint errors fixed