Fix query on external WMS