Weirdest bug fix I've ever seen

I'll have to send that out to stackoverflow one day