Commit ba58f23c broke comparison of nodes from different documents. Thanks to Olli Pottonen for the report.