Correct logic in is_error_entity().