Fixed logfile and link file bugs