Fixed bug when saving a record to serialize properly.