Fixed bug in #getFolders if the path is not a folder