repaired several jshint issues