Sanitize paths to avoid duplication