Fix label heicharchy bug

- Fix to keep label heicharchy intact after addition or removal of
  other labels.