Fix switching states tests