Fix an Exception on exit.