Fix logical disjunction and conjunction issues