           if attrs = allDeclareAttributeValues.get(path)
             for attrName of attrs
               declareAttributeValues[attrName] = attrs[attrName]
+
+    if currentAttributes
+      leafParam = currentPath
+      leafIsObject = currentAttributes.object?[1]
+      if leafIsObject == 0
+        leafTimestamp = Math.max(leafTimestamp, currentAttributes.object[0])
+    else
+      leafTimestamp = Math.max(leafTimestamp, currentTimestamp)
 
     switch (if currentPath[0] != '*' then currentPath[0] else leafParam[0])
       when 'Reboot'

          if declareAttributeValues.value?
            syncState.spv.set(currentPath, declareAttributeValues.value)

    if currentAttributes
      leafParam = currentPath
      leafIsObject = currentAttributes.object?[1]
      if leafIsObject == 0
        leafTimestamp = Math.max(leafTimestamp, currentAttributes.object[0])
    else
      leafTimestamp = Math.max(leafTimestamp, currentTimestamp)

    for child of children
      # This fine expression avoids duplicate visits
      if ((currentPath.wildcard ^ children[child][0].wildcard) & ((1 << currentPath.length) - 1)) >> leafParam.length == 0

    if (path.alias | path.wildcard) & 1 or path[0] == 'FactoryReset'
      sessionData.deviceData.paths.add(['FactoryReset'])

    if path.alias
      aliasDecs = device.getAliasDeclarations(path, declaration[1] or 1)
      for ad in aliasDecs
