Fix task's state.