minor fixes based on jshint comments