Fix patch_apply return type