Fixes #1141 and removed StubShutdownHandler

Any errors will be properly handled. Also didn't see the use for StubShutdownHandler after this patch.