Fix DiscoveryLoader when handling non folders.