Collapse union types where appropriate