Improve label position for tree layout