Make parcel code safer

Check if there is enough remaining data in the parcel and the data format when reading a field.