Fix some logic errors in loadexptemplates script and ensure script exits promptly once done.
Fix some logic errors in loadexptemplates script and ensure script exits promptly once done.

addrummond/nodeibexfarm,addrummond/nodeibexfarm,addrummond/nodeibexfarm