Add jshint, and fix all its issues. This fixes a couple bugs.