Good catch. Fixed the escaping.

Git blame would provide better explanations for why the copied functions exist than I could. This code preceded my involvement in the project by a few years. PR #565 removes this duplication.