Fix incorrect type transformation when the destination class is a mutable class. fixes #1201