Should no longer need any special code (since `on.exit()` works), but the scope is chunk-wise, not file-wise.