work in progress
Refinements to hidden state sync
Merge branch 'bugfix/hidden-state-sync'. Fixes #165