Now that Eric and I have both tested this, and Nicolas' comments have been taken into account, it would be great if a core maintainer could consider applying this patch :)
-- Timothy p.s. I'm specifically making a new reply to the version of the patch that should be looked at, in the hope that this might help with clarity when there are 4 different patches in this thread.