added wb checks; removed fix_free_writebuf