Consistency checking of labels with orphan detection