Entity update fix

The entity was being detached and then the new entity reattached. This
worked for the top level entity, but none of its children.