Add job number specific dumping and fix atexit() error