I thought the same, but clean tested working.  The variable resolution seems strange.  I moved all of that stuff down because stuff wasn't being picked up into OBJSXBMC from DIRECTORY_ARCHIVES.  I think all variables are resolved in order in one pass and then code is executed in another.