Fixing character escaping