Made the shutdown handler only handle fatal errors if it is the current error handler.