Thanks Daniel,
That appears to be OK but can't be sure as, in order to test the patch, I've had to partially rework a fix that we'd already implemented as a work-around. So everything is working for us but can't be sure whether it's entirely your patch that fixed it.
Presume the patch to the stubs ...