Fixed some bugs relating to label positioning