Fix change of state during repaint fase.