jslint fixes and removed dead code