Fix unloading perds on exit.