Fix bug where only the first escape character would be escaped.