fix errors found by JSHINT