Added state save point and swap to state.hxx