Fixing stream switching bug