Make sure the bot shuts down correctly