Fix logfile bug