Fixed variable scope issue in Entity.Text.