Tweak patch-writing string, plus bugfixes (#26)