Fix handling of object references

Turns out I never implemented the reading part of this