diff --git a/src/LbAnalysisProductions/config.py b/src/LbAnalysisProductions/config.py
index 847f597ae236a6cf0a7ffa374ade7895ea0bdc28..08841d1f93b6b1fe8e909130722ceccf54ab0a1a 100644
--- a/src/LbAnalysisProductions/config.py
+++ b/src/LbAnalysisProductions/config.py
@@ -52,7 +52,7 @@ s3_bucket = os.environ.get("AWS_S3_BUCKET")
 s3_access_key_id = os.environ.get("AWS_ACCESS_KEY_ID")
 s3_secret_access_key = os.environ.get("AWS_SECRET_ACCESS_KEY")
 if {s3_access_key_id, s3_secret_access_key, s3_bucket} == {None}:
-    print("No S3 crednetials specified, disabling")
+    print("No S3 credentials specified, disabling")
     s3_client = None
 else:
     s3_client = boto3.client(
diff --git a/src/LbAnalysisProductions/data/templates/dirac.cfg b/src/LbAnalysisProductions/data/templates/dirac.cfg
index 2463da5c4bd2c312302f6c584d8586698910c29b..ad54533421cc7942b696517d1d8edbddf7008a62 100644
--- a/src/LbAnalysisProductions/data/templates/dirac.cfg
+++ b/src/LbAnalysisProductions/data/templates/dirac.cfg
@@ -1,6 +1,6 @@
 DIRAC
 {
-    Setup=LHCb-Production
+    Setup={{ setup }}
 }
 LocalSite
 {
diff --git a/src/LbAnalysisProductions/execution/execute.py b/src/LbAnalysisProductions/execution/execute.py
index b0455908399639480d5f4109e9fc0c502c9abcf6..be654f40c5afbbee7d3179feadfebeea865332a9 100644
--- a/src/LbAnalysisProductions/execution/execute.py
+++ b/src/LbAnalysisProductions/execution/execute.py
@@ -6,7 +6,6 @@ import argparse
 import os
 from os.path import dirname, isdir, join
 import sys
-import shutil
 
 import sqlalchemy
 from sqlalchemy.orm import scoped_session, sessionmaker
@@ -42,12 +41,14 @@ def parse_args():
     else:
         with TemporaryDirectory() as fake_home_dir:
             os.environ["HOME"] = fake_home_dir
-            shutil.copyfile(
-                join(
-                    dirname(LbAnalysisProductions.__file__), "data/templates/dirac.cfg"
-                ),
-                join(fake_home_dir, ".dirac.cfg"),
-            )
+            from DIRAC import gConfig
+
+            setup = gConfig.getValue("/DIRAC/Setup")
+            dirac_cfg = LbAnalysisProductions.templates.get_template(
+                "dirac.cfg"
+            ).render(setup=setup)
+            with open(join(fake_home_dir, ".dirac.cfg"), "wt") as fp:
+                fp.write(dirac_cfg)
             os.environ["PYTHONUNBUFFERED"] = "1"
             subprocess.run(sys.argv + ["--no-setup-dirac"], check=False)