Fixing case-insensitive matching in filters (MID-1925) + tests. Fixing query schema.