Fix bug with text parsing