Correct the EndInstruction logic.