Fixed possible error writing to Stats.log.