Added support for directories.