Fixed entity and variable references using wrappers. Fixed entity communication bug.