Fix the inclusion processing for list of related items

/to @ritch 

The PR contains two things:

1. Fix the handling of include of an array of related items
2. Simplify the representation of typed array