Fix bug in widthOfTxt()