...
There are a couple of things that my patches don't handle:
Any feedback appreciated.

A couple of further thoughts:
Regards,
Paul