Fixing errors detected by jslint
Fix issues reported by JSLint