Corrected some typos and some errors reported by JSLint