Fixed bug with and improved filters special characters escaping.

Backslashes must be escaped twice. Comments in source code makes this
easier to understand.