This seems to apply only to Cray/ALPS systems. This partially reverts commit 5fc68cae It also adds a new check for NULL job_ptr