Working on #27

It works in some cases and not. Still required to save/restore other
states as well.