Fix errors mentioned by JSHint