Fix a logic issue introduced in recent refactoring

not a and not b and not c = not (a or b or c)