Fix bug where we /always/ created a new state group
Fix state tests