Fix: Queries are not escaped properly.

Now using the rendering function from the Math extension.

Change-Id: Ia7c8c04b6c36b6c5c8af71eb84f3241512470544