Fix most of the complaints from jshint.
Fix some typos.