Additions and corrections to ARCHETYPE_HRID implem