A new version of xia2 will be available already with these fixes in as part of the DIALS nightly builds. The fix is however a one-liner:
'REFINE(CORRECT)=%s\n' %' '.join(self._params.refine))
(amazing how much effect these little changes can make!) We are in the process if instigating a more thorough testing procedure which will ensure errors like this do not occur again.