Allow path iteration to include or disclude self

Change-Id: I881359d961e1c736fea2f165894db33ac23cd8e3