Do we use -1 to indicate errors for getSerializedSize()? If not, this may cause serialization problems.