Fix text alignment code