Fix bug with wrong cell state position during state restoration;