minor changes to Container.write()