Fix up state advancing
Assorted changes