Fixed problems with the text breaking algorithm