Fixing stream bugs