Fixed disconnectEntities and added name support