Fix crash when exiting long, paged outputs

  Fixes #26.