Fixes #6585

This is a commit for the local issue, pending testing for #6587.