Improve reliability of scripted tests (race condition?)