Fix errors found by JSHint