changes to please jslint, and make ktbs compatible