Fix logical expressions