Fixing a bug: Folder detection