Andrew,

Your suggested change did fix the problem. This module now works perfectly.

Thankyou very much for your help!

Also thanks to everyone who has developed, tested, and argued about this contrib.

Cheers
Reuben