bug fixes in stream_writable.lua