Fixing error on exit.