Fixes for entity reorganization