Fix directory validation handling.