Fix contract generation for mutable structures.