Added some wait-fors to fix more breakages.