Add a test for #7848
Fix tests after #7848