Fixed the resource collection factory for empty collections.