Fix bug #7474 with cursor positioning in overlay strings.