Bugfix, wait for subprocesses to end in instance manager script