Use better way of determining if we need to add PURLs to path.

From #4632.