MutateIncomingMessages and MutateOutgoingMessages not honouring replacement of instance

This PR fixes issue #1980 

@SimonCropp @andreasohlund should this go into 4.5 ?