Moved call to run-wait to a point after all other likely calls so that run wait can be used with other switches. Added blocking of remove whne a test has sub tests.