Fixed a bug in the ResourceCollectionFactory.