Fixed memory corruption bug in bc_read_stream.