fixed some issues reported by jslint