Fixed tracking of the flatten rule.

Flattening was also applied when the rule should not be applied.  The rule
should only be applied when we have "nested" ors.