Calum,
Given the time zone difference between us, I tried to go ahead and email a patch to you via direct email.
Alas, the email address your user account name shows, bounces with and unknown host error.
PM me with a good email address and I'll send the patch to you.
Dave