Sorry for all the commits/reverts on the #8038 issue - I had my changes accidentally in the branch for another change and didn't want to leave it there. Fixes #8038