Change quote to quote_plus and avoid double-escaping some problematic characters.

References issue #236.