jslint support
fixed a few things jslint and jshint complained about