This is a fix that @abenari helped find.  For some reason, it was used_ids was returning equal to inherited_ids which didn't make sense.  Not caching the variable makes it return correctly.