MODE-2297 Corrected asymmetric set operations

A recent change introduced a bug that caused some parts of joins to be removed when rewritten.