Fixing local querying