applied patch by Archaeopteryx [:aryx]

see https://bugzilla.mozilla.org/attachment.cgi?id=829429&action=diff