Improved startup and shutdown for tornado