Patches from stavros