diff --git a/VERSION b/VERSION
index 13e76d1a70caabadb702eef9744aedd3d865ae09..2d3310d95772193efa5937bea95ce8513cca1bed 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-VERSION=00.12
+VERSION=00.13
diff --git a/make-jobfeatures.htcondor b/make-jobfeatures.htcondor
index 0ee77dfa0001b2fbed6479676368086b7f2da61e..a669d6203467a690b5d9b7b6e8b4ca31e0c39fb2 100755
--- a/make-jobfeatures.htcondor
+++ b/make-jobfeatures.htcondor
@@ -59,6 +59,7 @@
 
 import os
 import re
+import pwd
 import sys
 import stat
 import time
@@ -105,30 +106,35 @@ if 'mjf_tmp_dir=' in fromRun + fromSysconfig:
   except:
     pass
 
+try:
+  userName = pwd.getpwuid(os.getuid())[0]
+except:
+  userName = str(os.getuid())
+
 # First make sure the mjfTmpDir/mjf-$USER directory exists
 try:
-  os.mkdir(mjfTmpDir + '/mjf-' + os.environ['USER'])
+  os.mkdir(mjfTmpDir + '/mjf-' + userName)
 except:
   # Ok if exists already
   pass
 
 try: 
-  userDirStat = os.stat(mjfTmpDir + '/mjf-' + os.environ['USER'])
+  userDirStat = os.stat(mjfTmpDir + '/mjf-' + userName)
 except:
-  print mjfTmpDir + '/mjf-' + os.environ['USER'] + ' could not be created'
+  print mjfTmpDir + '/mjf-' + userName + ' could not be created'
   sys.exit(12)
 
 # Check it is owned by us
 if userDirStat.st_uid != os.getuid() or userDirStat.st_gid != os.getgid():
-  print mjfTmpDir + '/mjf-' + os.environ['USER'] + ' has the wrong UID/GID'
+  print mjfTmpDir + '/mjf-' + userName + ' has the wrong UID/GID'
   sys.exit(13)
 
 # Ensure the right permissions
-os.chmod(mjfTmpDir + '/mjf-' + os.environ['USER'], 
+os.chmod(mjfTmpDir + '/mjf-' + userName, 
          stat.S_IRWXU + stat.S_IRGRP + stat.S_IXGRP + stat.S_IROTH + stat.S_IXOTH)
 
 # Now the directory for this job (but with # -> _)
-jobfeaturesDir = mjfTmpDir + '/mjf-' + os.environ['USER'] + '/jobfeatures-' + job_id.replace('#', '_')
+jobfeaturesDir = mjfTmpDir + '/mjf-' + userName + '/jobfeatures-' + job_id.replace('#', '_')
 
 try:
   os.mkdir(jobfeaturesDir)