Added second StateManager constructor.