Fix patch execution order
Merge pull request #822 from romainneutron/patch-order

[3.8] Fix patch execution order