Added support for dir.