Fix associativity of logic comparissons