Further work on directory handling.