Bugfix. Don't set last state if it is null.

This bug presented itself in a left sidebar that hovered above the main content
area instead of being shown next to it.

The reason was that the element class responsible for correctly displaying the elements
was removed when the last state was restored without checking if it's null.