More work on bug #7975.  I might have actually fixed it this time.