More robust replay file creation