Sort out escaping issues