Fixed ref/ptr mistakes