Added a log flush before exit 0 in log.c