See 49ce35b (which can be cherry-picked standalone) and updated 69da28c