Thanks Dave - that all seems OK now.
Although I am still confused because
a. I was sure it did work when I did it originally,
b. Presumably that was the code that WADA created.
In which case it would be interesting to see if anyone from WA can shed any light.