Fix a bug in write_ori that caused segfault if add_file wasn't used.