Fixed the job script so that job directories are cleaned up.