Much work on bug #8088.