Support for nested folder and fixed few other bugs