Fix a bug in the in-scope set that led to some lookupIdSubst errors