Adam: Fixing Error in finding best virtual path.

It was returning incorrect matches.