COOK-3533 - Evertrue eherot/fix multi servers code bugs

Also noticed when testing that the template included a reference to a class variable instead of a local variable in the loop.  Please let me know if you want this to be a separate pull request.