diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a2af2a52b966d86d011ab9d08fde9e0661e0a9c8..ba7555d4bca30c07dbd273569dbe8afa2850ac59 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -121,7 +121,7 @@ run_hba_calibrator:
   needs: ["versioning", "download_data"]
   image: $INTEGRATION_IMAGE
   script:
-    - cwltool --no-container --preserve-environment PATH --preserve-environment PREFACTOR_DATA_ROOT --preserve-environment PYTHONPATH --preserve-environment OPENBLAS_NUM_THREADS --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_hba_calibrator/ workflows/HBA_calibrator.cwl test_jobs/HBA_calibrator.json
+    - cwltool --no-container --preserve-environment PATH --preserve-environment PREFACTOR_DATA_ROOT --preserve-environment PYTHONPATH --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_hba_calibrator/ workflows/HBA_calibrator.cwl test_jobs/HBA_calibrator.json
     - test_jobs/check_workflow_results.py results /builds/eosc/prefactor3-cwl/data/results_calibrator
   after_script:
     - find /tmp/run_hba_calibrator -name "*.log" -print0 | tar czf hba_calibrator_logs.tar.gz --null -T -
@@ -135,7 +135,7 @@ run_hba_target:
   needs: ["versioning", "download_data"]
   image: $INTEGRATION_IMAGE
   script:
-    - cwltool --no-container --preserve-environment PATH --preserve-environment PREFACTOR_DATA_ROOT --preserve-environment PYTHONPATH --preserve-environment OPENBLAS_NUM_THREADS --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_hba_target/ workflows/HBA_target.cwl test_jobs/HBA_target.json
+    - cwltool --no-container --preserve-environment PATH --preserve-environment PREFACTOR_DATA_ROOT --preserve-environment PYTHONPATH --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_hba_target/ workflows/HBA_target.cwl test_jobs/HBA_target.json
     - test_jobs/check_workflow_results.py results /builds/eosc/prefactor3-cwl/data/results_target
   after_script:
     - find /tmp/run_hba_target -name "*.log" -print0 | tar czf hba_target_logs.tar.gz --null -T -
diff --git a/docs/source/calibrator.rst b/docs/source/calibrator.rst
index 34fd5720c99fb4bb313bbc1ff8b5c079b283ecd6..50dfb8138c0538fdfd18f546a9cd5970d2394697 100644
--- a/docs/source/calibrator.rst
+++ b/docs/source/calibrator.rst
@@ -258,10 +258,11 @@ A comprehensive explanation of the baseline selection syntax can be found `here`
 *Demixing options* (only used if demix step is added to the ``prep_cal_strategy`` variable)
 
 - ``demix_sources``: choose sources to demix (provided as list), e.g., ``[CasA,CygA]``
-- ``demix_target``: if given, the target source model (its patch in the SourceDB) is taken into account when solving (default: ``""``)
 - ``demix_freqstep``: number of channels to average when demixing (default: 16)
 - ``demix_timestep`` : number of time slots to average when demixing (default: 10)
-- ``demix``: enable demixing (default: ``false``)
+- ``demix``: if ``true`` force demixing using all sources of ``demix_sources``, if ``false`` do not demix (default: ``null``, automatically determines sources to be demixed according to ``min_separation``)
+- ``lbfgs_historysize``: for the LBFGS solver: the history size, specified as a multiple of the parameter vector, to use to approximate the inverse Hessian (default: 10)
+- ``lbfgs_robustdof``: for the LBFGS solver: the degrees of freedom (DOF) given to the noise model (default: 200)
 
 *Further pipeline options*
 
diff --git a/docs/source/parset.rst b/docs/source/parset.rst
index cf6a442ede78f7aed06256fa22df501ae57d503c..23002c603a0b08a55ac76dbc4da2c1d0b8de3d78 100644
--- a/docs/source/parset.rst
+++ b/docs/source/parset.rst
@@ -61,7 +61,6 @@ There are more parameters you may want to adjust that can be added to this input
         "do_transfer": false,
         "trusted_sources": "3C48,3C147,3C196,3C295,3C380",
         "demix_sources": ["CasA","CygA"],
-        "demix_target": "",
         "demix_freqstep": 16,
         "demix_timestep": 10,
         "demix": false,
@@ -78,7 +77,9 @@ There are more parameters you may want to adjust that can be added to this input
         "A-Team_skymodel": null,
         "avg_timeresolution": 4,
         "avg_freqresolution": "48.82kHz",
-        "bandpass_freqresolution": "195.3125kHz"
+        "bandpass_freqresolution": "195.3125kHz",
+        "lbfgs_historysize" : 10,
+        "lbfgs_robustdof" : 200
     }
 
 If you just want to alter one of the defaults it is sufficient to override it by specifing its new value the JSON input file::
diff --git a/docs/source/target.rst b/docs/source/target.rst
index 45f7b5674c45abbaf7ab7867b4b734a2fe68b031..f8edfc879d1ccc8c169910e3826e3e46a3b8e03f 100644
--- a/docs/source/target.rst
+++ b/docs/source/target.rst
@@ -280,10 +280,11 @@ A comprehensive explanation of the baseline selection syntax can be found `here`
 *Demixing and clipping options*
 
 - ``demix_sources``: choose sources to demix (provided as list), e.g., ``[CasA,CygA]``
-- ``demix_target``: if given, the target source model (its patch in the SourceDB) is taken into account when solving (default: ``""``)
 - ``demix_freqstep``: number of channels to average when demixing (default: 16)
 - ``demix_timestep`` : number of time slots to average when demixing (default: 10)
-- ``demix``: enable demixing (default: ``false``)
+- ``demix``: if ``true`` force demixing using all sources of ``demix_sources``, if ``false`` do not demix (default: ``null``, automatically determines sources to be demixed according to ``min_separation``)
+- ``lbfgs_historysize``: for the LBFGS solver: the history size, specified as a multiple of the parameter vector, to use to approximate the inverse Hessian (default: 10)
+- ``lbfgs_robustdof``: for the LBFGS solver: the degrees of freedom (DOF) given to the noise model (default: 200)
 - ``clip_sources``: list of the skymodel patches to be used for Ateamclipping (default: ``[VirA_4_patch,CygAGG,CasA_4_patch,TauAGG]``)
 
 *Further pipeline options*
diff --git a/scripts/make_summary.py b/scripts/make_summary.py
index 61e9572e48487c74c5c69f9d5bf71ea5d8b21cdc..0fb56fae887a9f855192662096720085dd2b3817 100755
--- a/scripts/make_summary.py
+++ b/scripts/make_summary.py
@@ -91,10 +91,9 @@ def main(flagFiles = None, pipeline = 'prefactor', run_type = 'calibrator', filt
 			demix_list = []
 			for i in range(len(json_output['metrics'][pipeline]['close_sources'])):
 				Ateam_name = json_output['metrics'][pipeline]['close_sources'][i]['source']
-				if demix:
-					if Ateam_name in demix_sources:
-						json_output['metrics'][pipeline]['close_sources'][i]['mitigation'] = 'demix'
-						demix_list.append(Ateam_name)
+				if Ateam_name in demix_sources and demix:
+					json_output['metrics'][pipeline]['close_sources'][i]['mitigation'] = 'demix'
+					demix_list.append(Ateam_name)
 				elif Ateam_name in clip_sources:
 					json_output['metrics'][pipeline]['close_sources'][i]['mitigation'] = 'clip'
 					clip_list.append(Ateam_name)
diff --git a/steps/H5ParmCollector.cwl b/steps/H5ParmCollector.cwl
index 04f836df64f78ac5b0132aa091274c971b9727b4..d1d295d3977b8df1939fa2a3b7f6a3216aab1ee6 100755
--- a/steps/H5ParmCollector.cwl
+++ b/steps/H5ParmCollector.cwl
@@ -12,7 +12,7 @@ baseCommand:
 inputs:
   - id: h5parmFiles
     type:
-      - 'File[]'
+      - File[]
       - File
     format: lofar:#H5Parm
     inputBinding:
diff --git a/steps/average.cwl b/steps/average.cwl
index 8990ba9c57c216f345f911d89e46b9c132692b7f..7db001165258d8f828f26c338cdc87d6fe17dcb7 100644
--- a/steps/average.cwl
+++ b/steps/average.cwl
@@ -79,7 +79,7 @@ outputs:
     outputBinding:
       glob: $(inputs.msout_name)
   - id: logfile
-    type: 'File[]'
+    type: File[]
     outputBinding:
       glob: average*.log
 arguments:
diff --git a/steps/check_demix.cwl b/steps/check_demix.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..ccbe3f08f4776193420c4b839630136890f2c25e
--- /dev/null
+++ b/steps/check_demix.cwl
@@ -0,0 +1,127 @@
+class: CommandLineTool
+cwlVersion: v1.2
+id: check_demix
+baseCommand:
+  - python3
+  - check_demix.py
+inputs:
+  - id: skymodel
+    type: File?
+  - id: demix_sources
+    type: string[]?
+    default:
+      - VirA_4_patch
+      - CygAGG
+      - CasA_4_patch
+      - TauAGG
+  - id: clip_sources
+    type: string[]?
+    default:
+      - VirA_4_patch
+      - CygAGG
+      - CasA_4_patch
+      - TauAGG
+  - id: demix
+    type: boolean?
+    inputBinding:
+        valueFrom: '$(self ? 1 : 0)'
+  - id: Ateam_separation_file
+    type: File
+
+outputs:
+  - id: out_demix
+    type: boolean
+    outputBinding:
+      loadContents: true
+      glob: 'out.json'
+      outputEval: '$(JSON.parse(self[0].contents).demix == 0 ? false : true)'
+  - id: out_demix_sources
+    type: string[]
+    outputBinding:
+      loadContents: true
+      glob: 'out.json'
+      outputEval: '$(JSON.parse(self[0].contents).demix_sources)'
+  - id: out_clip_sources
+    type: string[]
+    outputBinding:
+      loadContents: true
+      glob: 'out.json'
+      outputEval: '$(JSON.parse(self[0].contents).clip_sources)'
+  - id: logfile
+    type: File
+    outputBinding:
+      glob: check_demix.log
+label: check_demix
+
+requirements:
+  - class: InlineJavascriptRequirement
+  - class: InitialWorkDirRequirement
+    listing:
+     - entryname: check_demix.py
+       entry: |
+        import json
+        import os
+        import lsmtool
+        import numpy, math
+        null = None
+
+        targets = {'CasA'   : {'ra' : 6.123487680622104,  'dec' : 1.0265153995604648},   \
+                   'CygA'   : {'ra' : 5.233686575770755,  'dec' : 0.7109409582180791},   \
+                   'TauA'   : {'ra' : 1.4596748493730913, 'dec' : 0.38422502335921294},  \
+                   'HerA'   : {'ra' : 4.4119087330382163, 'dec' : 0.087135562905816893}, \
+                   'VirA'   : {'ra' : 3.276086511413598,  'dec' : 0.21626589533567378},  \
+                   'Sun'    : {'ra' : 0,                  'dec' : 0                  },  \
+                   'Jupiter': {'ra' : 0,                  'dec' : 0                  },  \
+                   'Moon'   : {'ra' : 0,                  'dec' : 0                  }}
+
+        inputs = json.loads(r"""$(inputs)""")
+
+        demix                 = inputs['demix']
+        demix_sources         = inputs['demix_sources']
+        clip_sources          = inputs['clip_sources']
+        skymodel              = inputs['skymodel']
+        Ateam_separation_file = inputs['Ateam_separation_file']["path"]
+
+        if skymodel is None:
+            skymodel = os.path.expandvars("$PREFACTOR_DATA_ROOT/skymodels/Ateam_LBA_CC.skymodel")
+        else:
+            skymodel = skymodel["path"]
+        s = lsmtool.load(skymodel)
+
+        f = open(Ateam_separation_file, 'r')
+        Ateam_separation = json.load(f)
+        f.close()      
+
+        if demix is None:
+            demix      = 0
+            demix_list = []
+            for item in Ateam_separation:
+                ra  = math.degrees(targets[item['source']]['ra'])
+                dec = math.degrees(targets[item['source']]['dec'])
+                dist_deg = s.getDistance(ra, dec, byPatch=True)
+                if any(dist_deg * 60.0 < 6.0):
+                    for index in numpy.where(dist_deg * 60 < 6.0)[0]:
+                        patch_name = s.getPatchNames()[index]
+                        if patch_name in demix_sources:
+                            demix_list.append(patch_name)
+                            demix = 1
+            demix_sources = demix_list
+        if demix == 1:
+            clip_sources  = list(set(clip_sources).difference(demix_sources))
+        
+        print("The following sources will be demixed: ", demix_sources)
+        print("The following sources will be clipped: ", clip_sources)
+
+        cwl_output = {"demix_sources" : demix_sources,
+                       "clip_sources" : clip_sources,
+                       "demix"        : demix}
+
+        with open('./out.json', 'w') as fp:
+            json.dump(cwl_output, fp)
+
+hints:
+  - class: DockerRequirement
+    dockerPull: lofareosc/prefactor3-cwl
+
+stdout: check_demix.log
+stderr: check_demix_err.log
diff --git a/steps/concatenate_files.cwl b/steps/concatenate_files.cwl
index fa7b040b2716cb5b9c188372ae234fdca8b52dc4..e6bfca3bcdc2822b4768c24dacf67c4ad7a0a9b0 100644
--- a/steps/concatenate_files.cwl
+++ b/steps/concatenate_files.cwl
@@ -6,7 +6,7 @@ baseCommand:
   - bulk_rename.sh
 inputs:
   - id: file_list
-    type: 'File[]'
+    type: File[]
     inputBinding:
       position: 0
   - id: file_prefix
diff --git a/steps/dppp_make_parset_cal.cwl b/steps/dppp_make_parset_cal.cwl
index ffa398f73421beb5b846c67ed6019eb5d14edaf8..8f56cbd5c0cb49a46db45d4a7d2b66913f058c03 100755
--- a/steps/dppp_make_parset_cal.cwl
+++ b/steps/dppp_make_parset_cal.cwl
@@ -16,7 +16,7 @@ inputs:
     type: int?
     default: 20
   - id: baselines_to_flag
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: elevation_to_flag
     type: string?
@@ -43,13 +43,19 @@ inputs:
     type: string?
     default: ''
   - id: subtract_sources
-    type: 'string[]?'
+    type: string[]?
     default:
       - CasA
       - CygA
   - id: ntimechunk
     type: int?
     default: 10
+  - id: lbfgs_historysize
+    type: int?
+    default: 10
+  - id: lbfgs_robustdof
+    type: float?
+    default: 200
 outputs:
   - id: output
     type: File
@@ -113,3 +119,7 @@ requirements:
           demix.freqstep                      =   1
           demix.timestep                      =   1
           demix.instrumentmodel               =   instrument
+          demix.uselbfgssolver                =   True
+          demix.lbfgs.historysize             =   $(inputs.lbfgs_historysize)
+          demix.lbfgs.robustdof               =   $(inputs.lbfgs_robustdof)
+          demix.maxiter                       =   20
diff --git a/steps/dppp_make_parset_target.cwl b/steps/dppp_make_parset_target.cwl
index 99a1738456037bd09ef6f9b8ccb9761891efc7cf..9b61b28eaf3a2fff0758fcaa8486aa3fefc00cb5 100755
--- a/steps/dppp_make_parset_target.cwl
+++ b/steps/dppp_make_parset_target.cwl
@@ -31,7 +31,7 @@ inputs:
     type: int?
     default: 20
   - id: baselines_to_flag
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: elevation_to_flag
     type: string?
@@ -61,7 +61,7 @@ inputs:
     type: string?
     default: 'pointing'
   - id: subtract_sources
-    type: 'string[]?'
+    type: string[]?
     default:
       - CasA
       - CygA
diff --git a/steps/dpppconcat.cwl b/steps/dpppconcat.cwl
index 09d87e2beaf895bb626f18f9b07c5afc9efdd195..951ad967927a4bdf7ffb08e6c4bc762ee3824183 100644
--- a/steps/dpppconcat.cwl
+++ b/steps/dpppconcat.cwl
@@ -141,7 +141,7 @@ outputs:
         glob: $(inputs.jsonfilename)
         outputEval: $(JSON.parse(self[0].contents).flagged_fraction_dict)
   - id: logfile
-    type: 'File[]'
+    type: File[]
     outputBinding:
       glob: concat*.log
 arguments:
diff --git a/steps/filter_ms_group.cwl b/steps/filter_ms_group.cwl
index c5aff4c44ab3685edb9056b960c3a831474ac6af..140b08855bafe6e0ce2c7e82f75f4b1b3579a799 100644
--- a/steps/filter_ms_group.cwl
+++ b/steps/filter_ms_group.cwl
@@ -14,7 +14,7 @@ inputs:
     inputBinding:
       position: 1
   - id: measurement_sets
-    type: 'Directory[]'
+    type: Directory[]
     inputBinding:
       position: 2
 outputs:
diff --git a/steps/filter_predict.cwl b/steps/filter_predict.cwl
index 4dd0561dfe3c0d38f6a376b21b789ad5d052d2cd..08732bc4b4234047d021ac4c193bdba4ba66f42d 100644
--- a/steps/filter_predict.cwl
+++ b/steps/filter_predict.cwl
@@ -36,7 +36,7 @@ inputs:
       separate: false
   - default: null
     id: sources
-    type: 'string[]?'
+    type: string[]?
     inputBinding:
       position: 0
       prefix: predict.sources=
diff --git a/steps/gaincal.cwl b/steps/gaincal.cwl
index bf62f4319e65d127fb65aa1d8317d3245805adca..b2cb425cebcaf0e0e503494cf2b5ce9913f54aa0 100644
--- a/steps/gaincal.cwl
+++ b/steps/gaincal.cwl
@@ -142,7 +142,7 @@ inputs:
       separate: false
   - default: null
     id: blrange
-    type: 'int[]?'
+    type: int[]?
     inputBinding:
       position: 0
       prefix: filter.blrange=
diff --git a/steps/plot_unflagged.cwl b/steps/plot_unflagged.cwl
index 5e742ad9660a293adca3058f3d936546ba0afb3c..9f2b23716f7c89bb087b519a2c2a92640a829275 100644
--- a/steps/plot_unflagged.cwl
+++ b/steps/plot_unflagged.cwl
@@ -5,7 +5,7 @@ baseCommand:
   - python3
 inputs:
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
     inputBinding:
       position: 1
   - id: unflagged_fraction
diff --git a/steps/predict.cwl b/steps/predict.cwl
index fe120d0ac7bd92b8dc737f4f375445d99e5c941f..727c74fb5f359e50529b8218c3255506a0a3eafc 100644
--- a/steps/predict.cwl
+++ b/steps/predict.cwl
@@ -36,7 +36,7 @@ inputs:
       separate: false
   - default: null
     id: sources
-    type: 'string[]?'
+    type: string[]?
     inputBinding:
       position: 0
       prefix: predict.sources=
diff --git a/steps/summary.cwl b/steps/summary.cwl
index 579ab8daf5b0350ccba25c65ed2b81d86d291543..8fd9609f771c83f5bdf2691e1ab9f22f7eb270fa 100644
--- a/steps/summary.cwl
+++ b/steps/summary.cwl
@@ -8,7 +8,7 @@ baseCommand:
 inputs:
   - id: flagFiles
     type:
-      - 'File[]'
+      - File[]
       - File
     inputBinding:
       position: 1
diff --git a/steps/uvplot.cwl b/steps/uvplot.cwl
index e95d7281ffe442089c01f2e67f4bca7de94bddc2..50adbec7ee2823dddc84e51d45ae847eae03b6fe 100644
--- a/steps/uvplot.cwl
+++ b/steps/uvplot.cwl
@@ -8,7 +8,7 @@ baseCommand:
 inputs:
   - id: MSfiles
     type:
-      - 'Directory[]'
+      - Directory[]
       - Directory
     inputBinding:
       position: 2
diff --git a/steps/wsclean.cwl b/steps/wsclean.cwl
index cceaf9b8252b02cb7c791e62a68c01ee30e8cd44..e44d33218b5305704ea2721ede8489d7da727671 100644
--- a/steps/wsclean.cwl
+++ b/steps/wsclean.cwl
@@ -5,7 +5,7 @@ baseCommand:
   - wsclean
 inputs:
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
     inputBinding:
       position: 2
       shellQuote: false
@@ -15,7 +15,7 @@ inputs:
     default:
       - 2500
       - 2500
-    type: 'int[]'
+    type: int[]
     inputBinding:
       position: 1
       shellQuote: false
@@ -206,7 +206,7 @@ outputs:
     outputBinding:
       glob: [$(inputs.image_name)-MFS-image.fits, $(inputs.image_name)-image.fits]
   - id: logfile
-    type: 'File[]'
+    type: File[]
     outputBinding:
       glob: 'wsclean*.log'
 label: WSClean
diff --git a/workflows/HBA_calibrator.cwl b/workflows/HBA_calibrator.cwl
index a989afee9020897ed28208641c13e2405b156000..f32f2f00a82f9c6d240d7b0016ce9e1eb0024012 100644
--- a/workflows/HBA_calibrator.cwl
+++ b/workflows/HBA_calibrator.cwl
@@ -4,12 +4,12 @@ id: HBA_calibrator
 label: HBA_calibrator
 inputs:
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
   - id: refant
     type: string?
     default: 'CS00.*'
   - id: flag_baselines
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: process_baselines_cal
     type: string?
@@ -32,7 +32,7 @@ inputs:
     type: int?
     default: 30
   - id: ampRange
-    type: 'float[]?'
+    type: float[]?
     default:
       - 0
       - 0
@@ -63,13 +63,12 @@ inputs:
     type: string
     default: '3C48,3C147,3C196,3C295,3C380'
   - id: demix_sources
-    type: 'string[]?'
+    type: string[]?
     default:
-      - CasA
-      - CygA
-  - id: demix_target
-    type: string?
-    default: ''
+      - VirA_4_patch
+      - CygAGG
+      - CasA_4_patch
+      - TauAGG
   - id: demix_freqstep
     type: int?
     default: 16
@@ -78,7 +77,6 @@ inputs:
     default: 10
   - id: demix
     type: boolean?
-    default: false
   - id: ion_3rd
     type: boolean?
     default: false
@@ -119,6 +117,12 @@ inputs:
   - id: bandpass_freqresolution
     type: string?
     default: 195.3125kHz
+  - id: lbfgs_historysize
+    type: int?
+    default: 10
+  - id: lbfgs_robustdof
+    type: float?
+    default: 200
 outputs:
   - id: log_files
     outputSource:
@@ -181,10 +185,7 @@ steps:
       - id: trusted_sources
         source: trusted_sources
       - id: demix_sources
-        source:
-          - demix_sources
-      - id: demix_target
-        source: demix_target
+        source: demix_sources
       - id: demix_freqstep
         source: demix_freqstep
       - id: demix_timestep
@@ -219,6 +220,10 @@ steps:
         source: avg_freqresolution
       - id: bandpass_freqresolution
         source: bandpass_freqresolution
+      - id: lbfgs_historysize
+        source: lbfgs_historysize
+      - id: lbfgs_robustdof
+        source: lbfgs_robustdof
     out:
       - id: logfiles
       - id: solutions
diff --git a/workflows/HBA_target.cwl b/workflows/HBA_target.cwl
index 6a20b74cee9f20e1477bfd09d20eb10a39f4f236..2cb2ff69cb36cedae5229b217d5abb00977239aa 100644
--- a/workflows/HBA_target.cwl
+++ b/workflows/HBA_target.cwl
@@ -4,14 +4,14 @@ id: HBA_target
 label: HBA_target
 inputs:
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
   - id: cal_solutions
-    type: 'File'
+    type: File
   - id: refant
     type: string?
     default: 'CS00.*'
   - id: flag_baselines
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: process_baselines_target
     type: string?
@@ -39,10 +39,12 @@ inputs:
     type: boolean?
     default: true
   - id: demix_sources
-    type: 'string[]?'
+    type: string[]?
     default:
-      - CasA
-      - CygA
+      - VirA_4_patch
+      - CygAGG
+      - CasA_4_patch
+      - TauAGG
   - id: demix_freqstep
     type: int?
     default: 16
@@ -51,7 +53,6 @@ inputs:
     default: 10
   - id: demix
     type: boolean?
-    default: false
   - id: apply_tec
     type: boolean?
     default: false
@@ -141,7 +142,7 @@ inputs:
     type: string?
     default: null
   - id: clip_sources
-    type: 'string[]?'
+    type: string[]?
     default:
       - VirA_4_patch
       - CygAGG
@@ -217,8 +218,7 @@ steps:
       - id: apply_beam
         source: apply_beam
       - id: demix_sources
-        source:
-          - demix_sources
+        source: demix_sources
       - id: demix_freqstep
         source: demix_freqstep
       - id: demix_timestep
diff --git a/workflows/LBA_calibrator.cwl b/workflows/LBA_calibrator.cwl
index baf35ae2d40de7a11343ce5f6efb20ad38606f66..0bfa3a330d26440273513160c44f0e2ff85ff4c3 100644
--- a/workflows/LBA_calibrator.cwl
+++ b/workflows/LBA_calibrator.cwl
@@ -4,12 +4,12 @@ id: HBA_calibrator
 label: HBA_calibrator
 inputs:
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
   - id: refant
     type: string?
     default: 'CS00.*'
   - id: flag_baselines
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: process_baselines_cal
     type: string?
@@ -32,7 +32,7 @@ inputs:
     type: int?
     default: 30
   - id: ampRange
-    type: 'float[]?'
+    type: float[]?
     default:
       - 0
       - 0
@@ -63,13 +63,12 @@ inputs:
     type: string
     default: '3C48,3C147,3C196,3C295,3C380'
   - id: demix_sources
-    type: 'string[]?'
+    type: string[]?
     default:
-      - CasA
-      - CygA
-  - id: demix_target
-    type: string?
-    default: ''
+      - VirA_4_patch
+      - CygAGG
+      - CasA_4_patch
+      - TauAGG
   - id: demix_freqstep
     type: int?
     default: 16
@@ -78,7 +77,6 @@ inputs:
     default: 10
   - id: demix
     type: boolean?
-    default: false
   - id: ion_3rd
     type: boolean?
     default: true
@@ -119,6 +117,12 @@ inputs:
   - id: bandpass_freqresolution
     type: string?
     default: 195.3125kHz
+  - id: lbfgs_historysize
+    type: int?
+    default: 10
+  - id: lbfgs_robustdof
+    type: float?
+    default: 200
 outputs:
   - id: log_files
     outputSource:
@@ -181,10 +185,7 @@ steps:
       - id: trusted_sources
         source: trusted_sources
       - id: demix_sources
-        source:
-          - demix_sources
-      - id: demix_target
-        source: demix_target
+        source: demix_sources
       - id: demix_freqstep
         source: demix_freqstep
       - id: demix_timestep
@@ -219,6 +220,10 @@ steps:
         source: avg_freqresolution
       - id: bandpass_freqresolution
         source: bandpass_freqresolution
+      - id: lbfgs_historysize
+        source: lbfgs_historysize
+      - id: lbfgs_robustdof
+        source: lbfgs_robustdof
     out:
       - id: logfiles
       - id: solutions
diff --git a/workflows/prefactor_calibrator.cwl b/workflows/prefactor_calibrator.cwl
index 637da95382a42e50bf15cd99e3c25f4d5f747e62..ade7b7be7c3b748ab58477f537b53f29fb28e05c 100644
--- a/workflows/prefactor_calibrator.cwl
+++ b/workflows/prefactor_calibrator.cwl
@@ -4,12 +4,12 @@ id: prefactor_calibrator
 label: prefactor_calibrator
 inputs:
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
   - id: refant
     type: string?
     default: 'CS00.*'
   - id: flag_baselines
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: process_baselines_cal
     type: string?
@@ -31,7 +31,7 @@ inputs:
     type: int?
     default: 30
   - id: ampRange
-    type: 'float[]?'
+    type: float[]?
     default:
       - 0
       - 0
@@ -62,13 +62,12 @@ inputs:
     type: string
     default: '3C48,3C147,3C196,3C295'
   - id: demix_sources
-    type: 'string[]?'
+    type: string[]?
     default:
-      - CasA
-      - CygA
-  - id: demix_target
-    type: string?
-    default: ''
+      - VirA_4_patch
+      - CygAGG
+      - CasA_4_patch
+      - TauAGG
   - id: demix_freqstep
     type: int?
     default: 16
@@ -77,7 +76,6 @@ inputs:
     default: 10
   - id: demix
     type: boolean?
-    default: false
   - id: ion_3rd
     type: boolean?
     default: false
@@ -118,6 +116,12 @@ inputs:
   - id: bandpass_freqresolution
     type: string?
     default: 195.3125kHz
+  - id: lbfgs_historysize
+    type: int?
+    default: 10
+  - id: lbfgs_robustdof
+    type: float?
+    default: 200
 outputs:
   - id: inspection
     linkMerge: merge_flattened
@@ -140,7 +144,7 @@ outputs:
       - fr/logfiles
       - bp/logfiles
       - ion/logfiles
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: summary_file
     outputSource:
@@ -192,8 +196,6 @@ steps:
         source: demix_timestep
       - id: demix_freqstep
         source: demix_freqstep
-      - id: demix_target
-        source: demix_target
       - id: demix_sources
         source:
           - demix_sources
@@ -213,6 +215,10 @@ steps:
         source: calibrator_path_skymodel
       - id: rfistrategy
         source: rfistrategy
+      - id: lbfgs_historysize
+        source: lbfgs_historysize
+      - id: lbfgs_robustdof
+        source: lbfgs_robustdof
     out:
       - id: outh5parm
       - id: logfiles
diff --git a/workflows/prefactor_calibrator/bandpass.cwl b/workflows/prefactor_calibrator/bandpass.cwl
index 8ffda35fd978716a4b02e487701fbdac9c37a729..f9d6294ab8a920217f18eaeaf331ab0c7ab65585 100644
--- a/workflows/prefactor_calibrator/bandpass.cwl
+++ b/workflows/prefactor_calibrator/bandpass.cwl
@@ -4,7 +4,7 @@ id: losoto_bandpass
 label: losoto_bandpass
 inputs:
   - id: ampRange
-    type: 'float[]?'
+    type: float[]?
     default: [0, 0]
   - id: skipInternational
     type: boolean?
@@ -37,7 +37,7 @@ outputs:
       - bandpass/logfile
       - interp/logfile
       - smoothb/logfile
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
 steps:
   - id: duplicateAbkp
diff --git a/workflows/prefactor_calibrator/bp.cwl b/workflows/prefactor_calibrator/bp.cwl
index caa8053822036fe677ff9748b4bfd8bcde6909b0..59228532f5133a7cf6dc58ec6bd2fdf08b5463f4 100644
--- a/workflows/prefactor_calibrator/bp.cwl
+++ b/workflows/prefactor_calibrator/bp.cwl
@@ -10,7 +10,7 @@ inputs:
     type: string?
     default: 'POINTING'
   - id: ampRange
-    type: 'float[]?'
+    type: float[]?
   - id: skipInternational
     type: boolean?
     default: true
@@ -30,13 +30,13 @@ inputs:
     type: boolean?
     default: true
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
   - id: h5parm
     type: File
   - id: solutions2transfer
     type: File?
   - id: inh5parm_logfile
-    type: 'File[]'
+    type: File[]
   - id: do_smooth
     type: boolean?
     default: false
@@ -68,7 +68,7 @@ outputs:
       - losoto_plot_B2/output_plots
       - losoto_plot_B3/output_plots
       - transfer_solutions/plots
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: outsolutions
     outputSource:
@@ -83,12 +83,12 @@ outputs:
       - concat_logfiles_apply_pa/output
       - concat_logfiles_apply_fr/output
       - concat_logfiles_beam/output
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: outh5parm_logfile
     outputSource:
       - h5parm_collector/log
-    type: 'File[]'
+    type: File[]
 steps:
   - id: bandpass
     in:
@@ -108,7 +108,7 @@ steps:
     out:
       - id: output_h5parm
       - id: logfiles
-    run: .//bandpass.cwl
+    run: ./bandpass.cwl
     label: bandpass
   - id: losoto_plot_A1
     in:
@@ -367,7 +367,7 @@ steps:
       - id: apply_pa.log
       - id: applybeam.log
       - id: final_flags_out
-    run: .//apply_calibrate_bp.cwl
+    run: ./apply_calibrate_bp.cwl
     label: apply_calibrate_bp
     scatter:
       - msin
diff --git a/workflows/prefactor_calibrator/clocktec.cwl b/workflows/prefactor_calibrator/clocktec.cwl
index 8f57a1869d1e1c88a7c4e1603de625491c92a03b..4423e91752e8ec952b2a74d7889a52eaae8fa958 100644
--- a/workflows/prefactor_calibrator/clocktec.cwl
+++ b/workflows/prefactor_calibrator/clocktec.cwl
@@ -30,7 +30,7 @@ outputs:
       - duplicateCbkp/log
       - smooth/logfile
       - losoto_flagstation/log
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: parset
     outputSource:
diff --git a/workflows/prefactor_calibrator/faraday_rotation.cwl b/workflows/prefactor_calibrator/faraday_rotation.cwl
index 988f97cf16de2b1718b2675a7248c2af43a300cf..1ab8a5165c4dc7f855c0f8a5946acce7fbf399d0 100644
--- a/workflows/prefactor_calibrator/faraday_rotation.cwl
+++ b/workflows/prefactor_calibrator/faraday_rotation.cwl
@@ -20,7 +20,7 @@ outputs:
     outputSource:
       - losoto_duplicate/log
       - losoto_faraday/log
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
 steps:
   - id: losoto_duplicate
diff --git a/workflows/prefactor_calibrator/fr.cwl b/workflows/prefactor_calibrator/fr.cwl
index 123f453482b17a7c5c1e559f4a141b05c133dda8..7e699024763fc0ef0f6adab905c0bd8ae768456e 100644
--- a/workflows/prefactor_calibrator/fr.cwl
+++ b/workflows/prefactor_calibrator/fr.cwl
@@ -10,14 +10,14 @@ inputs:
     type: boolean?
     default: true
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
   - id: h5parm
     type: File
   - id: refant
     type: string?
     default: 'CS001HBA0'
   - id: inh5parm_logfile
-    type: 'File[]'
+    type: File[]
   - id: do_smooth
     type: boolean?
     default: false
@@ -31,7 +31,7 @@ outputs:
   - id: msout
     outputSource:
       - apply_calibrate_fr/msout
-    type: 'Directory[]'
+    type: Directory[]
   - id: inspection
     outputSource:
       - losoto_plot_P3/output_plots
@@ -39,7 +39,7 @@ outputs:
       - losoto_plot_Rot3/output_plots
       - losoto_plot_A3/output_plots
       - losoto_plot_fr/output_plots
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: outsolutions
     outputSource:
@@ -51,12 +51,12 @@ outputs:
       - concat_logfiles_calib/output
       - concat_logfiles_blsmooth/output
       - concat_logfiles_apply/output
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: outh5parm_logfile
     outputSource:
       - h5parm_collector/log
-    type: 'File[]'
+    type: File[]
 steps:
   - id: faraday_rot
     in:
@@ -68,7 +68,7 @@ steps:
     out:
       - id: output_h5parm
       - id: logfiles
-    run: .//faraday_rotation.cwl
+    run: ./faraday_rotation.cwl
     label: FaradayRot
   - id: losoto_plot_P3
     in:
@@ -251,7 +251,7 @@ steps:
       - id: apply_cal.log
       - id: calib_cal.log
       - id: outh5parm
-    run: .//apply_calibrate_fr.cwl
+    run: ./apply_calibrate_fr.cwl
     label: apply_calibrate_fr
     scatter:
       - msin
diff --git a/workflows/prefactor_calibrator/ion.cwl b/workflows/prefactor_calibrator/ion.cwl
index 9ff08b4e95b6fa242db6c461fbe377163c59949d..1e2823346853f6b504f7d6d2ce74b3daed5b01bd 100644
--- a/workflows/prefactor_calibrator/ion.cwl
+++ b/workflows/prefactor_calibrator/ion.cwl
@@ -7,7 +7,7 @@ inputs:
     type: string?
     default: '*&'
   - id: demix_sources
-    type: 'string[]?'
+    type: string[]?
     default:
       - CasA
       - CygA
@@ -34,7 +34,7 @@ inputs:
     type: string?
     default: 'clock'
   - id: inh5parm_logfile
-    type: 'File[]'
+    type: File[]
   - id: maxStddev
     type: float?
     default: -1.0
@@ -54,7 +54,7 @@ outputs:
       - losoto_plot_tec3rd/output_plots
       - losoto_plot_clock/output_plots
       - losoto_plot_Pr/output_plots
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: outsolutions
     outputSource:
@@ -64,7 +64,7 @@ outputs:
     outputSource:
       - concat_logfiles_ion/output
       - concat_logfiles_summary/output
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
 steps:
   - id: clocktec
@@ -81,7 +81,7 @@ steps:
       - id: output_h5parm
       - id: logfiles
       - id: parset
-    run: .//clocktec.cwl
+    run: ./clocktec.cwl
     label: clocktec
   - id: losoto_plot_P3
     in:
diff --git a/workflows/prefactor_calibrator/ndppp_prep_cal.cwl b/workflows/prefactor_calibrator/ndppp_prep_cal.cwl
index 6c112cc4340b87fc9d153830cfd4010df47e827b..30788a4fc5c4d8fdbdc078b1fe83b5805325c09c 100644
--- a/workflows/prefactor_calibrator/ndppp_prep_cal.cwl
+++ b/workflows/prefactor_calibrator/ndppp_prep_cal.cwl
@@ -4,7 +4,7 @@ id: ndppp_prep_cal
 label: ndppp_prep_cal
 inputs:
   - id: baselines_to_flag
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: elevation_to_flag
     type: string?
@@ -52,8 +52,14 @@ inputs:
     type: int?
     default: 16
   - id: subtract_sources
-    type: 'string[]?'
+    type: string[]?
     default: []
+  - id: lbfgs_historysize
+    type: int?
+    default: 10
+  - id: lbfgs_robustdof
+    type: float?
+    default: 200
 outputs:
   - id: msout
     outputSource:
@@ -102,6 +108,10 @@ steps:
           - subtract_sources
       - id: ntimechunk
         source: ntimechunk
+      - id: lbfgs_historysize
+        source: lbfgs_historysize
+      - id: lbfgs_robustdof
+        source: lbfgs_robustdof
     out:
       - id: output
     run: ../../steps/dppp_make_parset_cal.cwl
diff --git a/workflows/prefactor_calibrator/pa.cwl b/workflows/prefactor_calibrator/pa.cwl
index 57f279e352f6bc3e1051fbe24317875382e3b653..b01b559ff320c766498294376f949967b71af9f6 100644
--- a/workflows/prefactor_calibrator/pa.cwl
+++ b/workflows/prefactor_calibrator/pa.cwl
@@ -10,14 +10,14 @@ inputs:
     type: boolean?
     default: true
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
   - id: h5parm
     type: File
   - id: refant
     type: string?
     default: 'CS001HBA0'
   - id: inh5parm_logfile
-    type: 'File[]'
+    type: File[]
   - id: do_smooth
     type: boolean?
     default: false
@@ -32,7 +32,7 @@ outputs:
   - id: msout
     outputSource:
       - apply_calibrate_pa/msout
-    type: 'Directory[]'
+    type: Directory[]
   - id: inspection
     outputSource:
       - losoto_plot_P3/output_plots
@@ -42,7 +42,7 @@ outputs:
       - losoto_plot_Align/output_plots
       - losoto_plot_Pr/output_plots
       - losoto_plot_Pr2/output_plots
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: outsolutions
     outputSource:
@@ -55,12 +55,12 @@ outputs:
       - concat_logfiles_blsmooth/output
       - concat_logfiles_beam/output
       - concat_logfiles_apply/output
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: outh5parm_logfile
     outputSource:
       - h5parm_collector/log
-    type: 'File[]'
+    type: File[]
 steps:
   - id: pol_align
     in:
@@ -74,7 +74,7 @@ steps:
     out:
       - id: output_h5parm
       - id: logfiles
-    run: .//pol_align.cwl
+    run: ./pol_align.cwl
     label: PolAlign
   - id: losoto_plot_P3
     in:
@@ -330,7 +330,7 @@ steps:
       - id: calib_cal.log
       - id: outh5parm
       - id: applybeam.log
-    run: .//apply_calibrate_pa.cwl
+    run: ./apply_calibrate_pa.cwl
     label: apply_calibrate_pa
     scatter:
       - msin
diff --git a/workflows/prefactor_calibrator/pol_align.cwl b/workflows/prefactor_calibrator/pol_align.cwl
index b71b286ead430e658205ed156ba6d947813a7df4..7f0f7410762584ef1226f056144c799455e9b6aa 100644
--- a/workflows/prefactor_calibrator/pol_align.cwl
+++ b/workflows/prefactor_calibrator/pol_align.cwl
@@ -25,7 +25,7 @@ outputs:
       - losoto_polalign/log
       - losoto_residual/log
     linkMerge: merge_flattened
-    type: 'File[]'
+    type: File[]
 
 steps:
   - id: losoto_duplicate
diff --git a/workflows/prefactor_calibrator/prep.cwl b/workflows/prefactor_calibrator/prep.cwl
index 08b8364a68f29571e9b330230a1db8f254dbb7dd..fc6fa6e0d9ecc885517afc575621cb13d50b2365 100644
--- a/workflows/prefactor_calibrator/prep.cwl
+++ b/workflows/prefactor_calibrator/prep.cwl
@@ -4,7 +4,7 @@ id: prep
 label: prep
 inputs:
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
   - id: filter_baselines
     type: string?
     default: '*&'
@@ -19,7 +19,6 @@ inputs:
     default: false
   - id: demix
     type: boolean?
-    default: false
   - id: max_dppp_threads
     type: int?
     default: 10
@@ -27,7 +26,7 @@ inputs:
     type: int?
     default: 20
   - id: flag_baselines
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: avg_timeresolution
     type: int?
@@ -44,11 +43,8 @@ inputs:
   - id: demix_freqstep
     type: int?
     default: 16
-  - id: demix_target
-    type: string?
-    default: ''
   - id: demix_sources
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: min_length
     type: int?
@@ -79,6 +75,12 @@ inputs:
     type:
       - File?
       - string?
+  - id: lbfgs_historysize
+    type: int?
+    default: 10
+  - id: lbfgs_robustdof
+    type: float?
+    default: 200
 outputs:
   - id: outh5parm
     outputSource:
@@ -91,7 +93,7 @@ outputs:
   - id: msout
     outputSource:
       - predict_calibrate/msout
-    type: 'Directory[]'
+    type: Directory[]
   - id: calibrator_name
     outputSource:
       - find_skymodel_cal/model_name
@@ -99,7 +101,7 @@ outputs:
   - id: outh5parm_logfile
     outputSource:
       - h5parm_collector/log
-    type: 'File[]'
+    type: File[]
   - id: check_Ateam_separation.json
     outputSource:
       - check_ateam_separation/output_json
@@ -123,8 +125,9 @@ outputs:
       - concat_logfiles_prep_cal/output
       - make_sourcedb_ateam/log
       - check_ateam_separation/logfile
+      - check_demix/logfile
       - aoflag/logfile
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
 steps:
   - id: select
@@ -153,8 +156,7 @@ steps:
         default: false
         source: raw_data
       - id: demix
-        default: false
-        source: demix
+        source: check_demix/out_demix
       - id: msin
         linkMerge: merge_flattened
         source:
@@ -180,18 +182,21 @@ steps:
         default: '*'
         source: process_baselines_cal
       - id: target_source
-        source: demix_target
+        source: find_skymodel_cal/model_name
       - id: ntimechunk
         default: 10
         source: max_dppp_threads
       - id: subtract_sources
-        source:
-          - demix_sources
+        source: check_demix/out_demix_sources
+      - id: lbfgs_historysize
+        source: lbfgs_historysize
+      - id: lbfgs_robustdof
+        source: lbfgs_robustdof
     out:
       - id: msout
       - id: flagged_fraction_dict
       - id: logfile
-    run: .//ndppp_prep_cal.cwl
+    run: ./ndppp_prep_cal.cwl
     label: ndppp_prep_cal
     scatter:
       - msin
@@ -216,7 +221,7 @@ steps:
       - id: calib_cal.log
       - id: flagged_fraction_dict
       - id: outh5parm
-    run: .//predict_calibrate.cwl
+    run: ./predict_calibrate.cwl
     label: predict_calibrate
     scatter:
       - msin
@@ -271,12 +276,37 @@ steps:
       - id: logfile
     run: ../../steps/check_ateam_separation.cwl
     label: check_Ateam_separation
+  - id: check_demix
+    in:
+      - id: demix
+        source: demix
+      - id: skymodel
+        source: A-Team_skymodel
+      - id: demix_sources
+        source: demix_sources
+      - id: clip_sources
+        default: []
+      - id: Ateam_separation_file
+        source: check_ateam_separation/output_json
+    out:
+      - id: out_demix
+      - id: out_demix_sources
+      - id: logfile
+    run: ../../steps/check_demix.cwl
+    label: check_demix
   - id: make_sourcedb_ateam
     in:
       - id: sky_model
         source: A-Team_skymodel
+      - id: output_file_name
+        source: make_sourcedb/sourcedb
+        valueFrom: $(self.basename)
+      - id: input_sourcedb
+        source: make_sourcedb/sourcedb
       - id: logname
         default: make_sourcedb_ateam.log
+      - id: append
+        default: true
     out:
       - id: sourcedb
       - id: log
diff --git a/workflows/prefactor_target.cwl b/workflows/prefactor_target.cwl
index 22b94148959c4bf983ad153b41eb1e26e3fe0bf3..8de0b30f258bdb9e1be139315e56b18fcf45a188 100644
--- a/workflows/prefactor_target.cwl
+++ b/workflows/prefactor_target.cwl
@@ -4,14 +4,14 @@ id: prefactor_target
 label: prefactor_target
 inputs:
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
   - id: cal_solutions
     type: File
   - id: refant
     type: string?
     default: CS00.*
   - id: flag_baselines
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: process_baselines_target
     type: string?
@@ -39,10 +39,12 @@ inputs:
     type: boolean?
     default: true
   - id: demix_sources
-    type: 'string[]?'
+    type: string[]?
     default:
-      - CasA
-      - CygA
+      - VirA_4_patch
+      - CygAGG
+      - CasA_4_patch
+      - TauAGG
   - id: demix_freqstep
     type: int?
     default: 16
@@ -51,7 +53,6 @@ inputs:
     default: 10
   - id: demix
     type: boolean?
-    default: false
   - id: apply_tec
     type: boolean?
     default: false
@@ -141,7 +142,7 @@ inputs:
     type: string?
     default: null
   - id: clip_sources
-    type: 'string[]?'
+    type: string[]?
     default:
       - VirA_4_patch
       - CygAGG
@@ -162,7 +163,7 @@ outputs:
       - prep/inspection
       - gsmcal/inspection
       - finalize/inspection
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: solutions
     outputSource:
@@ -171,13 +172,13 @@ outputs:
   - id: msout
     outputSource:
       - finalize/msout
-    type: 'Directory[]'
+    type: Directory[]
   - id: logfiles
     outputSource:
       - prep/logfiles
       - gsmcal/logfiles
       - finalize/logfiles
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: summary_file
     outputSource:
diff --git a/workflows/prefactor_target/concat.cwl b/workflows/prefactor_target/concat.cwl
index d9e92babdf6add571c6900a37485b4e50265fa9d..bbae3ea8a0f4ec1827782c0a06d4791f2b630050 100644
--- a/workflows/prefactor_target/concat.cwl
+++ b/workflows/prefactor_target/concat.cwl
@@ -4,7 +4,7 @@ id: concat
 label: concat
 inputs:
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
   - id: group_id
     type: string
   - id: groups_specification
diff --git a/workflows/prefactor_target/finalize.cwl b/workflows/prefactor_target/finalize.cwl
index 99fe4979964b7d01cb59949ebf4827e13530a798..6ace0840fe1d6aae30415d4ec666d1b241e2e8c6 100644
--- a/workflows/prefactor_target/finalize.cwl
+++ b/workflows/prefactor_target/finalize.cwl
@@ -10,19 +10,19 @@ inputs:
     type: float?
     default: 0.5
   - id: removed_bands
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: demix_sources
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: demix
     type: boolean?
     default: false
   - id: clip_sources
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
   - id: input_h5parm
     type: File
   - id: inh5parm_logfile
@@ -67,7 +67,7 @@ outputs:
   - id: msout
     outputSource:
       - apply_gsmcal/msout
-    type: 'Directory[]'
+    type: Directory[]
   - id: solutions
     outputSource:
       - h5parm_pointingname/outh5parm
@@ -80,14 +80,14 @@ outputs:
       - concat_logfiles_wsclean/output
       - concat_logfiles_summary/output
       - concat_logfiles_uvplot/output
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: inspection
     outputSource:
       - structure_function/structure_plot
       - wsclean/image
       - uvplot/output_image
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: summary_file
     outputSource:
diff --git a/workflows/prefactor_target/gsmcal.cwl b/workflows/prefactor_target/gsmcal.cwl
index 0b2bbf47a2f5c2a3f8cc9cf50642d223ca275163..4b3d84406d3c8a0900e67ef72e656e12854126b2 100644
--- a/workflows/prefactor_target/gsmcal.cwl
+++ b/workflows/prefactor_target/gsmcal.cwl
@@ -4,7 +4,7 @@ id: gsmcal
 label: gsmcal
 inputs:
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
   - id: filter_baselines
     type: string?
     default: '[CR]S*&'
@@ -50,7 +50,7 @@ outputs:
   - id: msout
     outputSource:
       - calibrate_target/msout
-    type: 'Directory[]'
+    type: Directory[]
   - id: outh5parm
     outputSource:
       - h5parm_collector/outh5parm
@@ -74,7 +74,7 @@ outputs:
       - losoto_plot_Pd/output_plots
       - losoto_plot_Pd2/output_plots
       - plot_unflagged/output_imag
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: out_refant
     outputSource:
@@ -91,12 +91,12 @@ outputs:
       - concat_logfiles_unflagged/output
       - ms_concat/logfile
       - aoflag/logfile
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: removed_bands
     outputSource:
       - check_unflagged_fraction/filenames
-    type: 'string[]'
+    type: string[]
   - id: total_bandwidth
     outputSource:
       - sort_times_into_freqGroups/total_bandwidth
diff --git a/workflows/prefactor_target/ndppp_prep_targ.cwl b/workflows/prefactor_target/ndppp_prep_targ.cwl
index 20ef8cd84dabf549cd9f1b92b773ad2f37872fb4..4804805aaaee033c43a6a6bf5aa480197efe0860 100644
--- a/workflows/prefactor_target/ndppp_prep_targ.cwl
+++ b/workflows/prefactor_target/ndppp_prep_targ.cwl
@@ -4,7 +4,7 @@ id: ndppp_prep_targ
 label: ndppp_prep_targ
 inputs:
   - id: baselines_to_flag
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: elevation_to_flag
     type: string?
@@ -49,7 +49,7 @@ inputs:
     type: int?
     default: 16
   - id: subtract_sources
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: parmdb
     type: File
@@ -75,7 +75,7 @@ inputs:
     type: boolean?
     default: true
   - id: clip_sources
-    type: 'string[]?'
+    type: string[]?
     default:
       - VirA_4_patch
       - CygAGG
diff --git a/workflows/prefactor_target/prep.cwl b/workflows/prefactor_target/prep.cwl
index c1292c68e4ffe44245e7b18f06a02598571e2b9e..3ac1ab69c639adffedbb2f67f8c9a72887987778 100644
--- a/workflows/prefactor_target/prep.cwl
+++ b/workflows/prefactor_target/prep.cwl
@@ -4,11 +4,11 @@ id: prep
 label: prep
 inputs:
   - id: msin
-    type: 'Directory[]'
+    type: Directory[]
   - id: cal_solutions
     type: File
   - id: flag_baselines
-    type: 'string[]?'
+    type: string[]?
     default: []
   - id: process_baselines_target
     type: string?
@@ -20,17 +20,19 @@ inputs:
     type: boolean?
     default: false
   - id: clip_sources
-    type: 'string[]?'
+    type: string[]?
     default:
       - VirA_4_patch
       - CygAGG
       - CasA_4_patch
       - TauAGG
   - id: demix_sources
-    type: 'string[]?'
+    type: string[]?
     default:
-      - CasA
-      - CygA
+      - VirA_4_patch
+      - CygAGG
+      - CasA_4_patch
+      - TauAGG
   - id: demix_freqstep
     type: int?
     default: 16
@@ -39,7 +41,6 @@ inputs:
     default: 10
   - id: demix
     type: boolean?
-    default: false
   - id: apply_tec
     type: boolean?
     default: false
@@ -136,12 +137,12 @@ outputs:
       - check_ateam_separation/output_imag
       - losoto_plot_RM/output_plots
       - plot_Ateamclipper/output_imag
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: msout
     outputSource:
       - dppp_prep_target/msout
-    type: 'Directory[]'
+    type: Directory[]
   - id: check_Ateam_separation.json
     outputSource:
       - check_ateam_separation/output_json
@@ -152,12 +153,13 @@ outputs:
       - make_sourcedb_target/log
       - make_sourcedb_ateam/log
       - check_ateam_separation/logfile
+      - check_demix/logfile
       - concat_logfiles_stationlist/output
       - concat_logfiles_RMextract/output
       - concat_logfiles_prep_targ/output
       - concat_logfiles_predict_targ/output
       - concat_logfiles_clipper_targ/output
-    type: 'File[]'
+    type: File[]
     linkMerge: merge_flattened
   - id: initial_flags_join_out
     outputSource:
@@ -267,6 +269,25 @@ steps:
       - id: logfile
     run: ../../steps/check_ateam_separation.cwl
     label: check_Ateam_separation
+  - id: check_demix
+    in:
+      - id: demix
+        source: demix
+      - id: skymodel
+        source: A-Team_skymodel
+      - id: demix_sources
+        source: demix_sources
+      - id: clip_sources
+        source: clip_sources
+      - id: Ateam_separation_file
+        source: check_ateam_separation/output_json
+    out:
+      - id: out_demix
+      - id: out_demix_sources
+      - id: out_clip_sources
+      - id: logfile
+    run: ../../steps/check_demix.cwl
+    label: check_demix
   - id: compare_station_list
     in:
       - id: msin
@@ -344,7 +365,7 @@ steps:
       - id: raw_data
         source: raw_data
       - id: demix
-        source: demix
+        source: check_demix/out_demix
       - id: msin
         linkMerge: merge_flattened
         source:
@@ -364,8 +385,7 @@ steps:
       - id: ntimechunk
         source: max_dppp_threads
       - id: subtract_sources
-        source:
-          - demix_sources
+        source: check_demix/out_demix_sources
       - id: parmdb
         source: createRMh5parm/h5parmout
       - id: apply_tec_correction
@@ -383,8 +403,7 @@ steps:
       - id: updateweights
         source: updateweights
       - id: clip_sources
-        source:
-          - clip_sources
+        source: check_demix/out_clip_sources
       - id: target_source
         source: targetname
       - id: lbfgs_historysize