fix issues reported by JSHint