Fix issue #9666, fix node-agent node detection in multiple instances scenario
