State saving and zsig cleanup