Fix possible wrong AND in comparison