Clean up ::write() usages.