         glyph.set(defaults)
         glyphs.push(glyph)
     plot_model = Collections('Plot').create(
-      x_range: xrange # TODO .ref() fails?
-      y_range: yrange
+      x_range: xrange.ref() # TODO .ref() fails?
+      y_range: yrange.ref()
       canvas_width: dims[0]
       canvas_height: dims[1]
       outer_width: dims[0]

          dimension: 0
          bounds: 'auto'
        }
        parent: plot_model.ref()
      )
      yrule = Collections('GuideRenderer').create(
        guidespec: {

          dimension: 1
          bounds: 'auto'
        }
        plot: plot_model.ref()
      )
      plot_model.add_renderers(
        [xrule.ref(), yrule.ref(), xaxis1.ref(), yaxis1.ref(), xaxis2.ref(), yaxis2.ref()]
