fixed issues found by jslint