Fix XXX is not defined errors.