Fix for TypeError and bug fixes for workflow execution

I discovered these problems today on ID23-2 and I have tested the patches on the beamline.