Fixed copy/move functionality for entities.