Fixed some character escaping issues in JS code