Some bugfixes to get streaming working correctly.