Fix.

When dir not there, then realpath returns nothing.
Problematic after clone for example.