Add logical operator precedence check