Fix Terminate() to be more graceful.