Fix composition of polymorphic variant types (fixes #9).