Fix and optimize except rules