Detects existing symlinks and handles them properly.