#1077 - Group and its children are hidden after being grouped again

also fixes issue when grouping nested groups that removes inner items from group and correctly selecting parent groups when all inner items are selected