Extended Compound flatten helper.