Some corrections on ungroup