Revert and fix escape char function.