Attached is an updated patch, fixing a compile error which my compilerdidn't seem to detect/suffer from and incorporating fixes to problemsraised by Neil.
Thanks,
Gavin