More work on bug #7393.
This fixes #7473.  It is not crash proof, but it is better.