Oops, same problem I had, I solved it, but did not update the zip-file, sorry. You need a new version of _apply.sh, see attached zip file. It is getting late, I will update the zip-file in the original message tomorrow.
W.r.t. your remark of simplification, my gtk knowledge is not that big, this is what I came up with. I am also not very pleased with the result, but it functions. The code is available, so if anyone feels that it needs improvement, you are free to change it