Going to stop letting the perfect be the enemy of the good.

Per @davehull's advice, I've fixed this so that it works, even though
it's not exactly how I wanted to do it. Tested on 3.0 x64 (workflow) and
3.0 x86 WOW (function). Will test on 4.0 x64 after commit, then merge
into my master and submit a pull request.