Updated the patch to consider References for all entities.