Fixed checking of subcomponent state having a type in composite state.
Renamed faield holding reference to state from reference to state.