Fix write length.
Fix write length.