Various bug fixes

I have a few bug fixes to the patches tool which Peter Maydell and I use.

Do you still use/maintain it?