Trying to cleanup the shutdown process.