Fixes U4-5077 doc types with compositions

@nul800sebastiaan  PR with proposed fix for compositions issue.
Can you make this InvariantCase please? :)