Further improvements in pattern extracting - marking fragment's nodes as visited to not visit them again.