Fix query escaping.