Bug 855586 - Patch in bug 824642 has wrong logic. r=nical.bugzilla