This is a prerequisite for #2217.