Fixed small typos in JavaScript