Fixes to some queries using variants