Clean states before layout.