OOIION-1561: Fix to agent control script
Merge pull request #1606 from mmeisinger/fix1561_fix_m

OOIION-1561: Fix to agent control script