Correct check for directory existence.