Correct some issues in text wrapping