Fix some issues with the Entity mage conversion