Fix Firefox bug with target element.