Covers issues #7682, #8159, #9085, #9927

and maybe some others.