public Object make(HGPersistentHandle handle, LazyRef<HGHandle[]> targetSet, IncidenceSetRef incidenceSet)
    {
    	if (graph.getHandleFactory().nullHandle().equals(handle))
    		return null;
        Record result = null;
        HGHandle [] targets = HGUtils.EMPTY_HANDLE_ARRAY;
        if (targetSet != null)
        {
            targets = targetSet.deref();
            if (targets == null)
                targets = HGUtils.EMPTY_HANDLE_ARRAY;
        }
        if (targets.length > 0)
            result = new LinkRecord(graph.getHandle(this), targets);
        else
            result = new Record(graph.getHandle(this));
        TypeUtils.setValueFor(graph, handle, result);
        HGPersistentHandle [] layout = slots.isEmpty() ? 
                                        HGUtils.EMPTY_HANDLE_ARRAY :
                                        graph.getStore().getLink(handle);
        if (layout.length != slots.size() * 2)
            throw new HGException("RecordType.make: Record value of handle " + 
                                  handle + 
                                  " does not match record type number of slots.");
        for (int i = 0; i < slots.size(); i++)
        {
        	HGHandle slotHandle = getAt(i);             
            Object value = null;
//            try
//            {
            if (!layout[2*i + 1].equals(graph.getHandleFactory().nullHandle()))
            {            	
	        	HGAtomRef.Mode refMode = getReferenceMode(slotHandle);
	        	if (refMode != null)
	        	{
	        		AtomRefType refType = graph.getTypeSystem().getAtomType(HGAtomRef.class);
	        		value = refType.make(layout[2*i + 1], null, null);
	        	}
	        	else
	        		value = TypeUtils.makeValue(graph, 
	        									layout[2*i + 1], 
	        									graph.getTypeSystem().getType(layout[2*i]));
            }
//            }
//            catch (HGException ex)
//            {
//            	Slot s = graph.get(slotHandle);
//            	System.err.println("Unable to get value for slot: " + s.getLabel());
//            	throw ex;
//            }
            result.set((Slot)graph.get(slotHandle), value);
        }
        return result;
    }