Added methods for rebuilding references after deserializing