More work on bug #8088.  The function applying is now correct, I think.