fixed copy stream implementations