making everything (mostly) jslint compliant