Fix increment error in PatchCode