Remove redundant loop in save() and save non-null values in write(). This change ensures that custom types need only return the value they want saved from toValue(), rather than also having to set this.value for the field.