Fix jobs stuck delayed
Clean up state machines