Properly handle inclusion and exclusion of code items