Make sure we shutdown before quitting.