Fix JSHint warning code and typo