Fix files migration to properly increment the referenceCount for new files.