Ignore duplicates in subpath finding

Caused a bug