Fixed bug that prevented folders from being deleted