Fix centering algorithm for labels and buttons