Close transactions in the right stage.