Fix order of operations for the union operator