Fixing the mess I created

My 89a1ea2382a434d2887a72eb8d1f0cab7b0b09eb stomped on changes of @borkweb's in e4526606aa3010ba891ffa68f7fe6c99b51d130d , which would be bad enough, but this started with me misunderstanding what happened in @methnen's 2658a5bf71e2ffdab514b3d562a3547e1d50828c, which also deleteted @borkweb's changes...but only because of what happened in 8130141c0a651dffc4157402ea2bd21eadc1da47 .

A previous commit brought back @borkweb's previously deleted code, I believe this change now properly integrates my earlier changes that I stomped on when doing that.