ensure default-directory is always a directory. Fixes #1.