fix jslint errors and warnings