State saving and (broken) restoration