OR/AND bug fixed