Fix character escaping