Properly handle unexpected termination.