Fix type analysis for logic expressions