fix charwrite2 propagation and initialization