Fixed another NPE in state machine