Added proper support for folders.