Fixes NPE on systems where $TMPDIR environment variable is not set