Making patchMsgJson use map instead of array iteration.