This fixes #7686.  I moved the two functions.