Attached is the final patch (just the two previously combined with a commit message). Would someone please double-check that it works on a platform other than macOS before I push it?