Hi!
Mesg.WriteField has side effects that modify the given field before writing it to the stream. Unexpected, but usually not a problem.
However: When a data message does not contain a field defined in the corresponding definition message,
Mesg.Write gets that field from the static
Profile class. That static field is then modified by the call to
WriteField which breaks other functions from then on...
I get an "Access denied" error when I try to post the code here inside code tags, so I attached a text file showing the original code and my fixed version. Hope it helps!