OOIION-1561: Fix to agent control script