I just posted my rewrite for 0.17+ in #884. I don't know what the policy is about bugs in 0.16.x as 0.17 is about to ship. If you want, you could rework your fix.