Dir existence algo improved (fixes #4)