Changed to handle Firefox bug (https://bugzilla.mozilla.org/show_bug.cgi?id=612118)