Fixed test for write stream