Work around bugs in nokogiri-java