Fix text wrap calculations