Fix relative paths with similar basenames