Fixed migration filenames, check if process has exited before waiting for exit