python statechart fixes