Added .wait() to the subprocess calls.