Correctly handle next'ing from a function that exits the application.