Some more work to smooth out the fix for bug #7632.