Improving matching invalid rows in query tables #380