Fix shutdown events not raised