fixed several jslint errors