Fix issues with control char escaping