Fix shape_utils genRIB function to use streams correctly.

fixes #290