Clean up if the script gets interrupted.