Enhance `path` detection.