Added support to exclude directories.