Fixed: crash bug at exit.