Comment 55 for bug 1846016

Okay, I think this patch is good and I have applied it internally. I'll push it you as soon as I get confirmation that the patch I posted in the previous comment works.