Fix "Invalid state transition, from critical to init" error