Thanks Terry and Mario for your recent patches. I haven't applied them as yet because I want to ensure they work by adding a unit test that exposes the problem. This is especially where the changes are deep within the core engine. I'm working on these and as soon as I have managed to create a the unit test I'll apply, verify and hopefully commit the patches.
-k.