Fixed characterRangeAtIndex: bug