Fix bug where shutdown-on-error cannot be called during init