jslint.com code review and error fixing