Fix logic error in the state enter condition examination.