Fixed 'register' bug which called finalizers in wrong order if upstream
terminated first.