Fix warnings.
Add handlers for on_write to data.