Comment 4 for bug 1734771

Full, and far more robust, fix in e283e84a85326834d57e8b130f44bfcd1a27595b.