LIB001-656 - Update to scripts following further testing to fix issues when no primary name for agents