Fixes #1038 - Use custom criteria to reliably determine what classes sub-collection lookups originated from