Fix crashes with Firefox 21