writestream fixes to fs.js