Update some patches, use a different method to apply patches.

It's a bit hackish, I need to work on a better method.