Fix reading references if a previously read reference is gced