Fix bug and JSLint