Fixed bugs in giving Goto commands to agents