fixed bug where applyDiff() was messing up session history in
setSessionState().

Change-Id: I9bd5b7704dead10b6d1e2c57f20a95ff77727c38