Fix generating of labels