Core: fix attached composite values (#339).

Thank you dgf for reporting!

Close ticket 339.
Merge branch 'attach-comp-value'