[WIP][3.9] Fix some patch migration issues