Overwrite by rename
Apparently test -d follows symlinks