Fixes to ProtoBuf serializer