Added Ref (reference) and corresponding tests.