Added some support for patches.