Fixed a regression where we closed a Statement too early.