Bugfix state in VariableEntity; add support of id in Entity; transition to use integer position of Entity.