Fix bugs for stream client