Well Gareth, yep, a little more work cut out for you. Maybe it was appropriate for me to post this in the Moodle Tracker because maybe someone will find a work around. Or they might simply tell you to fix your plugin.
I could not detect any harm in Moodle's operation (yet), so maybe I can just turn off debug messages (although I hate to do this because sometimes students let me know about these messages.)