Fixed some bugs in the labeler