Fixed minor bugs caught by jshint.