anchor.diff:        data.put( iris.persist.DatabasePeer.ID, primaryKey );
   
         final int attributesMask;
  -      if ( 0 != ( metadataMask & iris.beans.io.BeanCodec.MD_ATTR_MASK ) )
  +      if ( includeToDate )
  +      {
  +         attributesMask = SERVER_TO_SERVER_ATTR_MASK_FOR_TYPE_CODE[typeCode];
  +      }
  +      else
         {
            attributesMask = input.readInt();
         }
  -      else
  -      {
  -        attributesMask = SERVER_TO_SERVER_ATTR_MASK_FOR_TYPE_CODE[typeCode - 1];
  -      }
  -      if ( 0 != ( metadataMask & iris.beans.io.BeanCodec.MD_TO_AND_FROM_DATES ) )
  +      if ( includeToDate )
         {
            final long to = input.readLong();
            if ( 0 != to )
  
positive.code:       }
  <% end %>
     }
  <% end %>
  }
negative.code:     return -1;
    }
  
    public static java.util.Map<String, Object> readBean( final byte[] input, final boolean includeToDate )
      throws java.io.IOException, ClassNotFoundException
    {
      return readBean( new java.io.ObjectInputStream( new java.io.ByteArrayInputStream( input ) ), includeToDate );
    }
  
    private static java.util.Map<String, Object> readBean( final java.io.ObjectInput input, final boolean includeToDate )
       throws java.io.IOException, ClassNotFoundException
    {
        final java.util.Map<String, Object> data = new java.util.HashMap<String, Object>();
  