[3.9] Fix patches inheritance