XD-1412: composed and profiles

Commit 8140537 has a fix for for 1412, as well as unit test.
Commit 584d357 is a cherry pick from previous work that lead me to discover the bug described in 1412, so this acts as an additional validation test