HHH-5845 - Fix collection queries